Answer the question
In order to leave comments, you need to log in
How to activate several functions at once?
Greetings, I need several functions to work at once with a certain command (but so that they also work separately from each other)
Example code
@bot.message_handler(commands=['hellofirst'])
def hellofirst(message):
bot.send_message(message.chat.id, 'Hello1')
@bot.message_handler(commands=['hellosecond'])
def hellosecond(message):
bot.send_message(message.chat.id, 'Hello2')
@bot.message_handler(commands=['hellothird'])
def hellothird(message):
bot.send_message(message.chat.id, '{0} and {1}'.format(hellofirst,hellosecond)
Answer the question
In order to leave comments, you need to log in
Flex container inside which block with dots occupies all free space. In this case, you can set any properties and background for it:
If you set the default border to a dot ( dotted
) then you can simply do this with this border:<hr>
hr {
border: none;
border-top: 3px dotted #dbdbdb;
}
Create another function in which the rest of the functions will go into threads:
from threading import Thread
def l1():
pass
def l2():
pass
def go():
Thread(target=l1).start()
Thread(target=l2).start()
Good afternoon! I once assigned 4 functions to one button and wrote the same command 4 times, but with different functions. There is also an option to shove all these functions into another. I don’t know how this will affect the robotic ability, but it’s worth a try)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question