Good afternoon I have a bot for a site where I go and wanted to develop a function where it sends a private message in the system. In my head it seems simple but I can not execute (I know the code is wrong but that's how I imagined it).
I'm a beginner in the programming area and wanted help on how to solve this.
It's quite simple, the user would call /sms
to the bot and soon he would capture everything he had in front of /sms
. Then he would pick it up and play it on the chat.
It would be a function of speaking anonymously, can someone help me?
I know it's a silly question but I have this question.
Thank you in advance.
(Edit) I have managed to solve the problem but when I send the message it reproduces the code too!
#private mensagem
def mensagemprivate(self, message, name_sender, to=''):
if re.findall('/sms .*', message):
self.post(message=message)
elif '/sms' in message:
t_mensagemprivate = threading.Thread(target=self.mensagemprivate, args=(message, name_sender, id_sender))
t_mensagemprivate.start()