mirror of
https://github.com/nexy7574/LCC-bot.git
synced 2024-09-19 10:03:40 +01:00
26 lines
505 B
Python
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)
|