OokamiPupV2/cmd_discord.py

35 lines
1.1 KiB
Python

# cmd_discord.py
from discord.ext import commands
def setup(bot):
@bot.command()
async def greet(ctx):
from cmd_common.common_commands import greet
result = greet(ctx.author.display_name, "Discord")
await ctx.send(result)
@bot.command()
async def ping(ctx):
from cmd_common.common_commands import ping
result = ping()
await ctx.send(result)
@bot.command()
async def howl(ctx):
"""Calls the shared !howl logic."""
from cmd_common.common_commands import generate_howl_message
result = generate_howl_message(ctx.author.display_name)
await ctx.send(result)
@bot.command()
async def reload(ctx):
""" Dynamically reloads Discord commands. """
try:
import cmd_discord
import importlib
importlib.reload(cmd_discord)
cmd_discord.setup(bot)
await ctx.send("Commands reloaded!")
except Exception as e:
await ctx.send(f"Error reloading commands: {e}")