runabot/Christmas/Cogs/Commands_Mail.py

20 lines
902 B
Python
Raw Normal View History

2023-11-25 17:28:48 +00:00
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
2023-11-26 04:27:34 +00:00
from Christmas.UI.Modal import Send_Mail_Modal
2023-11-25 17:28:48 +00:00
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()
2023-11-26 04:27:34 +00:00
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)
2023-11-25 17:28:48 +00:00
def setup(bot):
bot.add_cog(CMail(bot))