mirror of
https://github.com/skoobasteeve/useful-scripts.git
synced 2026-03-22 00:18:56 +00:00
initial working base-bot
This commit is contained in:
24
movie-bot/moviebot.py
Normal file
24
movie-bot/moviebot.py
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
from telegram.ext import Updater, CommandHandler, CallbackContext
|
||||
import logging
|
||||
from telegram import Update
|
||||
import os
|
||||
|
||||
token = os.environ.get("TG_BOT_TOKEN")
|
||||
|
||||
updater = Updater(token=token, use_context=True)
|
||||
dispatcher = updater.dispatcher
|
||||
|
||||
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
level=logging.INFO)
|
||||
|
||||
def start(update: Update, context: CallbackContext):
|
||||
context.bot.send_message(chat_id=update.effective_chat.id, text="I'm a bot, please talk to me!")
|
||||
|
||||
start_handler = CommandHandler('start', start)
|
||||
dispatcher.add_handler(start_handler)
|
||||
|
||||
|
||||
updater.start_polling()
|
||||
|
||||
Reference in New Issue
Block a user