Пример #1
0
def get_bot(token: str):
    # create bot with given token
    bot = Bot(token, router=router)

    # Pass middleware that sets parse_mode to 'html' if it is none.
    bot.middleware(DefaultValuesMiddleware(parse_mode=ParseModeType.html))

    return bot
Пример #2
0
def get_bot(token: str):
    # create bot with given token
    bot = Bot(token,
              router=router,
              globals_class=munch.Munch,
              context_data_class=munch.Munch)

    # Pass middleware that sets parse_mode to 'html' if it is none.
    bot.middleware(DefaultValuesMiddleware(parse_mode=ParseModeType.html))

    return bot
Пример #3
0
def get_bot(token: str):
    bot = Bot(token, router=router, globals_class=munch.Munch, context_data_class=munch.Munch)
    bot.middleware(DefaultValuesMiddleware(parse_mode=ParseModeType.html))
    return bot
Пример #4
0
    #end=datetime.now()
    #elapsed=end-start
    #print(elapsed)
    return message


from rocketgram import Bot, Dispatcher, UpdatesExecutor
from rocketgram import context, commonfilters
from rocketgram import SendMessage
import time
import nest_asyncio
nest_asyncio.apply()
token = '1756164387:AAHWjHOz5rVjzfu-uqgaaRkzsiB5mjMDFHY'
symbols = u
router = Dispatcher()
bot = Bot(token, router=router)


@router.handler
@commonfilters.command('/start')
async def start_command():
    await SendMessage(-1001455990819, 'Hello there!').send()


@router.handler
@commonfilters.command('/help')
async def start_command():
    await SendMessage(-1001455990819, 'Some userful help!').send()


@router.handler