Home > other >  Ask questions, written in Python and cool Q robot, start no should be loaded after I write a Python
Ask questions, written in Python and cool Q robot, start no should be loaded after I write a Python

Time:10-15




File distribution as shown (order)
The content of the program:
The
reference
import cqplus
The import re
The class MainHandler (cqplus CQPlusHandler) :
Def handle_event (self, event, params) :
# # # # #
If the event=='on_private_msg:
Self. API. Send_private_msg (params [' from_qq], 'have accepted to the message)
MSG=params [' MSG ']
If re search (' eating ', MSG, re i.) :
Self. API. Send_private_msg (params [' from_qq], 'match')
The else:
Self. API. Send_private_msg (params [' from_qq], 'match')
# # # # # private chat for the above content, if the received message, will reply: has received messages matching success or failure//dinner for keywords, received the message content contains dinner will send matching success,
# # # # #
If the event=='on_group_msg:
Self. API. Send_group_msg (params [' from_group], 'have accepted to the message)
MSG=params [' MSG ']
If re search (' eating ', MSG, re i.) :
Self. API. Send_group_msg (params [' from_group], 'match')
The else:
Self. API. Send_group_msg (params [' from_group], 'match')
# # # # # chatting for the above content, and a private chat to reflect can analogy

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Copy the contents of the other bloggers test
Copyright statement: this article to CSDN blogger (cnAXB) of the original articles, follow BY CC 4.0 - SA the copyright agreement, reproduced and this statement, please attach the original source link
The original link: https://blog.csdn.net/qq_44778120/article/details/97621015
(copied, don't mind,,)
First question, only 20 points are given
  • Related