

send( '🫡', chat = admin async def function_name_5( self, message: Message): """This function will be executed when someone types ("hello" or/and "hi") and "world".""" await self. clear( 5, message) # delete last 5 messages (in telegram only works if a user_bot is activated in current chat) async def function_name_4( self, message: Message): """This function will be executed when someone types "house" or/and "home".""" await self. delete_message, bot_message) # delete the response message after 3 seconds async def function_name_3( self, message: Message): send( 'Message deleted.', message) # keep the response message await flanautils. delete_message( message) # deletes the received message bot_message = await self. """ This function will be executed when someone types exactly "multibot". send( 'Hi!', message) # response in same chat of received message context async def function_name_2( self, message: Message): """ This function will be executed when someone types something like "hello".

function_name_7, default = True)Īsync def function_name_1( self, message: Message): function_name_4,, ]) # <- note that is Iterable] self. function_name_2, 'multibot', min_score = 1) Import os import random import flanautils from multibot import Message, TelegramBot, admin, bot_mentioned class MyBot( TelegramBot): always=True functions don't affect to determine if default=True functions are called. """ This function will be executed if no other function is determined by provided keywords. register( default = True) async def function_name_7( message: Message): """This function will be executed always but returns if bot isn't mentioned.""" if not bot. register( always = True) async def function_name_6( message: Message): """This function will be executed when someone types "troll" but returns if he isn't an admin.""" if not message. register( 'troll') async def function_name_5( message: Message):

"""This function will be executed when someone types ("hello" or/and "hi") and "world".""" await bot. register(, ]) # <- note that is Iterable] # 'hi'), ('world',))) <- same # hi', ]) <- same # hi', 'world']) !!! NOT same, this is "or" logic (like previous case) async def function_name_4( message: Message): clear( 5, message) # delete last 5 messages (in telegram only works if a user_bot is activated in current chat) bot. """This function will be executed when someone types "house" or/and "home".""" await bot. register( 'house home') # 'home']) <- same # 'home')) <- same async def function_name_3( message: Message): delete_message, bot_message) # delete the response message after 3 seconds bot. delete_message( message) # deletes the received message bot_message = await bot. register( 'multibot', min_score = 1) async def function_name_2( message: Message): send( 'Hi!', message) # response in same chat of received message context bot. register( 'hello') async def function_name_1( message: Message): Import os import random import flanautils from multibot import Message, TelegramBot bot = TelegramBot(Īpi_id = os.
