KAILASHSINGH9 / Davaldog

0 stars 0 forks source link

Davaldogs #2

Open KAILASHSINGH9 opened 1 week ago

KAILASHSINGH9 commented 1 week ago

from telegram import Update, ForceReply from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext import logging

Enable logging

logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)

Start command

def start(update: Update, context: CallbackContext) -> None: user = update.effective_user update.message.reply_text( f"Hello {user.mention_html()}! Welcome to DavalDogs. Type /game to start playing.", reply_markup=ForceReply(selective=True), parse_mode='HTML', )

Game command

def game(update: Update, context: CallbackContext) -> None: update.message.reply_text("Typing game started! Type the word 'dog' as fast as you can!")

Main function

def main() -> None:

Replace 'YOUR_TOKEN' with your actual bot token

updater = Updater("YOUR_TOKEN") 

8149744153:AAG1Yn5h03IJh0DDbs48y4hUY4R1xuOVyTw

# Get the dispatcher to register handlers
dispatcher = updater.dispatcher

# Register command handlers
dispatcher.add_handler(CommandHandler("start", start))
dispatcher.add_handler(CommandHandler("game", game))

# Start the Bot
updater.start_polling()

# Run the bot until you send a signal to stop
updater.idle()

if name == 'main': main()

KAILASHSINGH9 commented 1 week ago

Send url