8000 GitHub - palagutaa/gtp
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

palagutaa/gtp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 

Repository files navigation

gtp

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

Enable logging

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

logger = logging.getLogger(name)

Define a function to handle the /start command

def start(update: Update, context: CallbackContext) -> None: update.message.reply_text('Hi! I am a simple echo bot. Send me a message and I will echo it back.')

Define a function to handle incoming messages

def echo(update: Update, context: CallbackContext) -> None: update.message.reply_text(update.message.text)

def main() -> None: # Create the Updater and pass it your bot's token updater = Updater("YOUR_BOT_TOKEN")

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

# Define handlers
dispatcher.add_handler(CommandHandler("start", start))
dispatcher.add_handler(MessageHandler(Filters.text & ~Filters.command, echo))

# Start the Bot
updater.start_polling()

nviniofnvinf fvi nifnvienfv' vniernveriv snvirpvnerv vnireo indicniodncinwepc hjjjjjjjjggbjhbbbbbbbbbbbbbbjh им шщвиам ивашщмишиам

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0