telegram bot to send msg to users

This commit is contained in:
andrea
2025-11-29 23:34:26 +01:00
parent 1f28d73ae6
commit 1e2f715ff3
6 changed files with 66 additions and 0 deletions

18
bot.py Normal file
View File

@@ -0,0 +1,18 @@
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
await update.message.reply_text(f'wb_alert bot: <code>{chat_id}</code>', 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()