Time:10-15
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
Page link:https//www.codepudding.com/other/66162.html