R
R
reizer_12022-02-26 12:20:45
Python
reizer_1, 2022-02-26 12:20:45

Calling your function in aiogram?

I know how to call a function from a function, but I'm a little confused in aiogram. There is a repeating code:

await message.answer('Вы можете написать нашему менеджеру @........  ', reply_markup=ReplyKeyboardRemove())
   await state.finish()

I wanted to implement it by placing an example in a separate function, but I don’t know what to pass as arguments in order for message.answer to work correctly:
async def help_fun(??????????????):
               await message.answer('Вы можете написать нашему менеджеру @.........  ', reply_markup=ReplyKeyboardRemove())
               await state.finish()

In the code itself, the function is called like this and something must also be passed as an argument:
async def var_tea(message : types.Message, state: FSMContext):
        if message.text == '/help':
                help_fun(???????????)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2022-02-26
@mmmaaak

if no parameters are needed inside the function, then nothing needs to be passed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question