college-bot-v1/main.py
2022-09-13 14:00:27 +01:00

26 lines
505 B
Python

import discord
from discord.ext import commands
import config
bot = commands.Bot(
commands.when_mentioned_or("h!"),
debug_guilds=config.guilds
)
@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)
return await ctx.respond(
f"\N{white heavy check mark} Pong! `{gateway}ms`."
)
bot.run(config.token)