아직도 텔레그램 안쓰니?
텔레그램 봇으로 주사위 이모지 보내고 값을 가져오기 본문
https://core.telegram.org/bots/api#senddice
sendDice 메서드를 사용한다
dice에 value가 주사위의 값이다
https://api.telegram.org/bot<BotToken>/sendDice?chat_id=<ChatID>
https://docs.python-telegram-bot.org/en/stable/telegram.chat.html#telegram.Chat.send_dice
https://docs.python-telegram-bot.org/en/stable/telegram.bot.html#telegram.Bot.send_dice
async def dice_command(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
message = await context.bot.send_dice(chat_id=update.effective_chat.id)
print(message.dice.value)
'텔레그램 팁' 카테고리의 다른 글
텔레그램 저장한 메시지 업데이트 (1) | 2024.02.11 |
---|---|
텔레그램 봇으로 스티커 보내기 (0) | 2024.01.07 |
텔레그램 봇 ReplyKeyboardMarkup 버튼 코드 (0) | 2024.01.04 |
텔레그램 봇 나만 사용하기 (1) | 2024.01.04 |
새로 찾은 텔레그램 채널 검색 사이트 (18) | 2024.01.03 |