messages.SetGameScore

class pyrogram.raw.functions.messages.SetGameScore

Use this method to set the score of the specified user in a game sent as a normal message (bots only).

Details:
  • Layer: 227

  • ID: 8EF8ECC0

Parameters:
  • peer (InputPeer) – Unique identifier of target chat

  • id (int 32-bit) – Identifier of the sent message

  • user_id (InputUser) – User identifier

  • score (int 32-bit) – New score

  • edit_message (bool, optional) – Set this flag if the game message should be automatically edited to include the current scoreboard

  • force (bool, optional) – Set this flag if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters

Returns:

Updates

TL Schema

messages.setGameScore#8ef8ecc0
flags:#
edit_message:flags.0?true
force:flags.1?true
peer:InputPeer
id:int
user_id:InputUser
score:int

= Updates

Parameter Tree

SetGameScore
├── edit_message → true (optional)
├── force → true (optional)
├── peer → InputPeer
│ ├── InputPeerEmpty
│ ├── InputPeerSelf
│ ├── InputPeerChat
│ │ └── chat_id → long
│ ├── InputPeerUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ ├── InputPeerChannel
│ │ ├── channel_id → long
│ │ └── access_hash → long
│ │ ├── peer → InputPeer
│ │ │ ├── InputPeerEmpty
│ │ │ ├── InputPeerSelf
│ │ │ ├── InputPeerChat
│ │ │ ├── InputPeerUser
│ │ │ ├── InputPeerChannel
│ │ │ ├── InputPeerUserFromMessage
│ │ │ └── InputPeerChannelFromMessage
│ │ ├── msg_id → int
│ │ └── user_id → long
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── channel_id → long
├── id → int
├── user_id → InputUser
│ ├── InputUserEmpty
│ ├── InputUserSelf
│ ├── InputUser
│ │ ├── user_id → long
│ │ └── access_hash → long
│ └── InputUserFromMessage
│ ├── peer → InputPeer
│ │ ├── InputPeerEmpty
│ │ ├── InputPeerSelf
│ │ ├── InputPeerChat
│ │ ├── InputPeerUser
│ │ ├── InputPeerChannel
│ │ ├── InputPeerUserFromMessage
│ │ └── InputPeerChannelFromMessage
│ ├── msg_id → int
│ └── user_id → long
└── score → int

Example

await app.invoke(
    SetGameScore(
        edit_message=None,
        force=None,
        peer=await app.resolve_peer(chat_id),
        id=0,
        user_id=await app.resolve_user(chat_id),
        score=0,
    )
)