Add main.py
This commit is contained in:
parent
62c1701ba2
commit
d500343920
1 changed files with 19 additions and 0 deletions
19
main.py
Normal file
19
main.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
import hikari
|
||||
import img_source
|
||||
bot = hikari.GatewayBot(token="your token here")
|
||||
|
||||
@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:
|
||||
message = img_source.main()
|
||||
await event.message.respond(message[1])
|
||||
|
||||
bot.run()
|
Loading…
Reference in a new issue