You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
527 B
Python
20 lines
527 B
Python
import hikari
|
|
|
|
bot = hikari.GatewayBot(token="...")
|
|
|
|
@bot.listen()
|
|
async def ping(event: hikari.GuildMessageCreateEvent) -> None:
|
|
"""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
|
|
|
|
me = bot.get_me()
|
|
|
|
if me.id in event.message.user_mentions_ids:
|
|
await event.message.respond("Pong!")
|
|
|
|
bot.run()
|
|
|
|
# This is just a basic script to have minimal functionality at the very least. |