Update 'buttons/bot.py'

Signed-off-by: Mitsuo Makuda <mitsuo_makuda@bdsmhypnosisbasement.com>
This commit is contained in:
mitsuo_makuda committed 2022-12-05 01:21:49 +00:00
1 parent c4681a413d
commit 858c56dda0
1 file changed
+7 -2
+7 -2
View File
@@ -4,10 +4,15 @@ bot = hikari.GatewayBot(token="...")
@bot.listen()
async def ping(event: hikari.GuildMessageCreateEvent) -> None:
if event.is_bot or not event.content:
"""If a non-bot user mentions your bot, respond with 'Pong!'."""
# Do not respond to bots nor webhooks pinging us, only user accounts
if not event.is_human:
return
if event.content.startswith("hk.ping"):
me = bot.get_me()
if me.id in event.message.user_mentions_ids:
await event.message.respond("Pong!")
bot.run()