From b750b3f50dcc6960344bab330b922adfdf80f020 Mon Sep 17 00:00:00 2001 From: Xsarz <88231084+xXxCLOTIxXx@users.noreply.github.com> Date: Sun, 9 Jun 2024 22:42:59 +0300 Subject: [PATCH] Update README.md --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2cc9ff5..d21e619 100644 --- a/README.md +++ b/README.md @@ -46,14 +46,17 @@ print(f"LOGIN: OK.") @client.event(amino.arguments.wsEvent.on_text_message) def text_msg(data: amino.objects.Event): - if data.comId is None or data.message.author.userId == client.userId: return + if data.comId is None or data.message.author.uid == client.userId: return print(f"New message: {data.message.content}") + try: + com_client = amino.CommunityClient(client.profile, data.comId) + if data.message.content.lower().split(" ")[0] == "ping": + com_client.send_message(data.message.threadId, "Pong!", replyTo=data.message.messageId) + elif data.message.content.lower().split(" ")[0] == "pong": + com_client.send_message(data.message.threadId, "Ping!", replyTo=data.message.messageId) + except Exception as e: + print(e) - com_client = amino.CommunityClient(client.profile, data.comId) - if data.message.content.lower().split(" ")[0] == "ping": - com_client.send_message(data.message.chatId, "Pong!", replyTo=data.message.messageId) - elif data.message.content.lower().split(" ")[0] == "pong": - com_client.send_message(data.message.chatId, "Ping!", replyTo=data.message.messageId) ```