college-bot-v1/main.py

28 lines
678 B
Python
Raw Normal View History

2022-09-13 14:00:27 +01:00
import discord
from discord.ext import commands
import config
2022-09-13 20:50:02 +01:00
from utils import registry
2022-09-13 14:00:27 +01:00
bot = commands.Bot(
2022-09-13 21:27:14 +01:00
commands.when_mentioned_or("h!"), debug_guilds=config.guilds, allowed_mentions=discord.AllowedMentions.none()
2022-09-13 14:00:27 +01:00
)
2022-09-13 21:19:23 +01:00
bot.load_extension("jishaku")
2022-09-13 20:50:02 +01:00
bot.load_extension("cogs.verify")
bot.loop.run_until_complete(registry.create_all())
2022-09-13 14:00:27 +01:00
@bot.event
async def on_ready():
print("Logged in as", bot.user)
@bot.slash_command()
async def ping(ctx: discord.ApplicationContext):
"""Checks the bot's response time"""
gateway = round(ctx.bot.latency * 1000, 2)
2022-09-13 21:27:14 +01:00
return await ctx.respond(f"\N{white heavy check mark} Pong! `{gateway}ms`.")
2022-09-13 14:00:27 +01:00
bot.run(config.token)