from discord import Member, SlashCommandGroup, Option from discord.ext.commands import Cog, cooldown, BucketType, command, has_permissions, bot_has_permissions, Context, guild_only, bot_has_guild_permissions, check from Christmas.UI.Modal import Send_Mail_Modal class CMail(Cog): def __init__(self, bot): self.bot = bot MAIL = SlashCommandGroup(name="편지", description="편지를 보내거나 확인합니다.") @MAIL.command(name="보내기", description="편지를 보냅니다.") @cooldown(1, 10, BucketType.user) @guild_only() async def _send(self, ctx: Context, member: Option(Member, name="보낼사람", description="편지를 받을 사람을 선택해주세요.", required=True)): modal = Send_Mail_Modal(reciveuser=member, title="편지 보내기") await ctx.send_modal(modal) def setup(bot): bot.add_cog(CMail(bot))