From 8bed6ca30880f189db1d0dd0aac6cdef256e7c09 Mon Sep 17 00:00:00 2001 From: tmddn3070 Date: Mon, 11 Dec 2023 02:17:12 +0900 Subject: [PATCH] 1.3.1 --- Christmas/Cogs/Commands_Util.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Christmas/Cogs/Commands_Util.py b/Christmas/Cogs/Commands_Util.py index b5aadf5..498ad64 100644 --- a/Christmas/Cogs/Commands_Util.py +++ b/Christmas/Cogs/Commands_Util.py @@ -21,7 +21,20 @@ class CUtil(Cog): await ctx.respond(embed=Default_Embed.register_sucess()) except Exception as e: await ctx.respond(embed=Default_Embed.register_failed()) - + + @guild_only() + @has_permissions(administrator=True) + @cooldown(1, 10, BucketType.user) + @slash_command(name="서버탈퇴", description="서버에서 탈퇴합니다.") + async def _leave(self, ctx: Context): + try: + if not await database.get_guild(ctx.guild.id): return await ctx.respond(embed=Default_Embed.not_register(), ephemeral=True) + #await database.leave_guild(ctx.guild.id) + await ctx.respond(embed=Default_Embed.leave_sucess()) + except Exception as e: + await ctx.respond(embed=Default_Embed.leave_failed()) + + @guild_only() @cooldown(1, 10, BucketType.user) @slash_command(name="봇정보", description="봇의 정보를 확인합니다.")