runabot/Christmas/Cogs/Commands_Arcade.py

33 lines
1.8 KiB
Python
Raw Normal View History

2023-12-02 10:42:36 +00:00
import io
from discord import SlashCommandGroup, Option, Member, Color, File, Attachment
from discord.ext.commands import Cog, BucketType, cooldown, guild_only, Context, has_permissions
from Christmas.Database import database
from Christmas.UI.Embed import ChristmasEmbed, Arcade_Embed, Default_Embed
from Christmas.UI.Buttons import Arcade_Register_Agree
from Christmas.Cogs.Event import model
class CArcade(Cog):
def __init__(self, bot):
self.bot = bot
ARCADE = SlashCommandGroup(name="눈싸움", description="눈싸움 관련 명령어")
@cooldown(1, 5, BucketType.user)
@has_permissions(administrator=True)
@guild_only()
@ARCADE.command(name="등록", description="눈싸움 등록")
async def _등록(self, ctx: Context):
if not await database.get_guild(ctx.guild.id): return await ctx.respond(embed=ChristmasEmbed(title="❌ 에러!", description="서버가 가입되어있지 않아요! 서버를 가입해주세요!", color=Color.red()),ephemeral=True)
#if await database.get_arcade(ctx.guild.id): return await ctx.respond(embed=Arcade_Embed.register_already(), ephemeral=True)
await ctx.respond(embed=Arcade_Embed.register_inital(), view=Arcade_Register_Agree(), ephemeral=True)
@guild_only()
@cooldown(1, 10, BucketType.user)
@ARCADE.command(name="정보", description="눈싸움 정보")
async def _정보(self, ctx: Context):
if not await database.get_guild(ctx.guild.id): return await ctx.respond(embed=ChristmasEmbed(title="❌ 에러!", description="서버가 가입되어있지 않아요! 서버를 가입해주세요!", color=Color.red()),ephemeral=True)
if await database.get_arcade(ctx.guild.id): return await ctx.respond(embed=Arcade_Embed.register_already(), ephemeral=True)
pass
def setup(bot):
bot.add_cog(CArcade(bot))