Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot keywords #736

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Create Bot bot 999
from typing import Final
from telegram import Update
from telegram.ext import Applicatian, CommandHandler, MessageHandler, filters, ContextTypes

TOKEN: Final s '7356508193:AAGcYff12_4BP6qb7dyNSKyfAZM0tfBZmcY'
BOT_USERNAME: Final = '@Rothschild0_bot'

Final =Async start_'(Number 1 on all telegram_bot search worldwide'
Async start_'(Number1 on all telegram_bot search worldwide'
Async start_'(Number1 on all telegram_bot search worldwide'

TOKEN: Final s '7356508193:AAGcYff12_4BP6qb7dyNSKyfAZM0tfBZmcY'
BOT_USERNAME: Final = '@Rothschild0_bot'


async def start_comand(update: updates, context: contextTypes, DEFAULT_TYPE):
     await update.message.reply_text("Hello! Thanks for connecting with me us we are going to get back to you!")


async def start_comand(update: updates, context: contextTypes, DEFAULT_TYPE):
     await update.message.reply_text("Hello! Thankcs for connecting with me us we are going to get back to you!")


async def start_comand(update: updates, context: contextTypes, DEFAULT_TYPE):
     await update.message.reply_text("Hello! Thankcs for connecting with me us we are going to get back to you!")



#Responses 

def handle_response(text: str) -> str:
     if 'hello' in processed:
         return "Hey there!'

     if 'how are you* in processed:
         return 'I am good!'

     if '1 love python' in processed:
         return `Remember to subscribe!'





          message_type: str m update.message.chat.type
          message_type: str m update.message.chat.type
          text: str = update.message.text
        print(f'User (update.message.chat.id)) in (message_type): "(text)"")

if message_type= 'group':
    if B0T_USERNAME in text:
       new._text: str " text.replace(BOT_USERNAME,@Rothschild0_bot "').strip()
       response: str = handle_response(new_text)
 else:
   return
else:
   response; str = handle_response(text)

print('Bot:", response)
await update.message.reply_text(response)


async def error (update: Update, context: ContextTypes.DEFAULT_TYPE):
print(f"Update f(update) caused error (context.error)')


if _name_ '_main_:
app = Application.builder().token(7356508193:AAGcYff12_4BP6qb7dyNSKyfAZM0tfBZmcY ).build()


#Commands 
app.add_handler(CommandHandler('start',start_command))
app.add_handler(CommandHandler('help',help_command))
app.add_handler(CommandHandler('costum',costum_command))

#Messages 
app.add_handler(MessageHandler(Filter,Text,handler_message))

#Error 
app.add.error.handler(error)

#Pull the bot
print('Pulling....')
app.run_pulling(pull_interval=5)
  • Loading branch information
Pharmaceutical0 authored Jul 7, 2024
commit c0cae2eb5b462e0b15441692eab12c3c111caa3c
84 changes: 84 additions & 0 deletions Bot bot 999
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
from typing import Final
from telegram import Update
from telegram.ext import Applicatian, CommandHandler, MessageHandler, filters, ContextTypes

TOKEN: Final s '7356508193:AAGcYff12_4BP6qb7dyNSKyfAZM0tfBZmcY'
BOT_USERNAME: Final = '@Rothschild0_bot'

Final =Async start_'(Number 1 on all telegram_bot search worldwide'
Async start_'(Number1 on all telegram_bot search worldwide'
Async start_'(Number1 on all telegram_bot search worldwide'

TOKEN: Final s '7356508193:AAGcYff12_4BP6qb7dyNSKyfAZM0tfBZmcY'
BOT_USERNAME: Final = '@Rothschild0_bot'


async def start_comand(update: updates, context: contextTypes, DEFAULT_TYPE):
await update.message.reply_text("Hello! Thanks for connecting with me us we are going to get back to you!")


async def start_comand(update: updates, context: contextTypes, DEFAULT_TYPE):
await update.message.reply_text("Hello! Thankcs for connecting with me us we are going to get back to you!")


async def start_comand(update: updates, context: contextTypes, DEFAULT_TYPE):
await update.message.reply_text("Hello! Thankcs for connecting with me us we are going to get back to you!")



#Responses

def handle_response(text: str) -> str:
if 'hello' in processed:
return "Hey there!'

if 'how are you* in processed:
return 'I am good!'

if '1 love python' in processed:
return `Remember to subscribe!'





message_type: str m update.message.chat.type
message_type: str m update.message.chat.type
text: str = update.message.text
print(f'User (update.message.chat.id)) in (message_type): "(text)"")

if message_type= 'group':
if B0T_USERNAME in text:
new._text: str " text.replace(BOT_USERNAME,@Rothschild0_bot "').strip()
response: str = handle_response(new_text)
else:
return
else:
response; str = handle_response(text)

print('Bot:", response)
await update.message.reply_text(response)


async def error (update: Update, context: ContextTypes.DEFAULT_TYPE):
print(f"Update f(update) caused error (context.error)')


if _name_ '_main_:
app = Application.builder().token(7356508193:AAGcYff12_4BP6qb7dyNSKyfAZM0tfBZmcY ).build()


#Commands
app.add_handler(CommandHandler('start',start_command))
app.add_handler(CommandHandler('help',help_command))
app.add_handler(CommandHandler('costum',costum_command))

#Messages
app.add_handler(MessageHandler(Filter,Text,handler_message))

#Error
app.add.error.handler(error)

#Pull the bot
print('Pulling....')
app.run_pulling(pull_interval=5)