P
P
panamboor2020-11-21 12:55:45
Bots
panamboor, 2020-11-21 12:55:45

Telegram bot python (how to get dice value(send_dice))?

await bot.send_dice(message.from_user.id, "") // An animated die is sent to the user.
..................?.....................//get the value of this die and write it to a variable

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
soremix, 2020-11-21
@panamboor

await msg = bot.send_dice()
print(msg)

Look for the desired value if it is a Message object - it has a dice field equal to 1 to 6
https://dev-docs.aiogram.dev/api/types/message/

K
Kirkarr, 2022-04-14
@Kirkarr

Here is the answer

msg=await m.reply_dice() 
print(msg.dice.value)

written in aiogram

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question