Update 'buttons/bot.py'

Signed-off-by: Mitsuo Makuda <mitsuo_makuda@bdsmhypnosisbasement.com>
pull/2/head
Mitsuo Makuda 2 years ago
parent c4681a413d
commit 858c56dda0

@ -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()

Loading…
Cancel
Save