Created
April 15, 2022 02:59
-
-
Save kmye/feaf99d3e492887ed2081914297a2ceb to your computer and use it in GitHub Desktop.
Telethron Bot Send Message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from telethon.sync import TelegramClient | |
from telethon import Button, types | |
api_id = 123456 # replace with your chat id | |
api_hash = 'replace_with_api_hash' | |
bot_token = 'bot_token_from_your_bot_father' | |
CHAT_ID = -123456 # replace with your chat id | |
bot = TelegramClient('bot', api_id, api_hash).start(bot_token=bot_token) | |
with bot: | |
bot.send_message(types.PeerChannel(CHAT_ID), 'Bye Keyboard!', buttons=Button.clear()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment