23 lines
752 B
Python
23 lines
752 B
Python
from telegram.ext import Application
|
|
from telegram.ext import CommandHandler
|
|
import syms as _bot_syms
|
|
|
|
async def bot_start(update, context):
|
|
chat_id = update.effective_chat.id
|
|
try: thread_id= update.message.message_thread_id
|
|
except: thread_id= None
|
|
txt= f'wb_alert bot: <code>{chat_id}</code>'
|
|
if thread_id: txt= f'wb_alert bot: <code>{chat_id}</code> thread: <code>{thread_id}</code>'
|
|
await update.message.reply_text(txt, parse_mode='HTML')
|
|
print(f'alert_bot bot_start: {chat_id}')
|
|
|
|
def main():
|
|
application = Application.builder().token(_bot_syms.TOKEN).build()
|
|
application.add_handler(CommandHandler('start', bot_start))
|
|
|
|
print('alert_bot main: Bot is running...')
|
|
application.run_polling()
|
|
|
|
if __name__ == '__main__':
|
|
main()
|