My code
API - Python3
import os
API - Interactions
import interactions
from interactions import (
Extension, BaseContext, SlashContext,
# errors, utils,
)
Load Modules
import Config.staff_config as staff_cfg
###############################################################################
from Logger import bot_logger
my_logger = bot_logger.init_logger(os.path.basename(file))
###############################################################################
my_role = int(staff_cfg.my_moderator_id)
class Moderator_Commands(Extension):
async def my_check(ctx: BaseContext):
return ctx.member.has_role(my_role)
@interactions.slash_command(
name="moderator",
description="Moderator Commands",
)
@interactions.check(my_check)
async def moderator(self, ctx: SlashContext):
await ctx.send("You are a Moderator of this bot!", ephemeral=True)