async def keep_clear_disable_command(self, ctx: commands.Context, *argv): if ctx.channel == None: await ctx.author.send("請在頻道中設置這個指令") return if ChannelUtil.hasChannel(ctx.guild.id, ctx.channel.id, Util.ChannelType.AUTO_DELETE): ChannelUtil.removeChannel(ctx.guild.id, ctx.channel.id, Util.ChannelType.AUTO_DELETE) await ctx.channel.send('取消這個頻道自動刪除成員留言功能') self.database.remove_ignore_xp_channel(ctx.guild.id, ctx.channel.id)
async def command_control_remove(self, ctx: commands.Context, command: str): if not self.__hasCommand__(command): await ctx.send(f"指令{command}錯誤, 請檢查拼寫是否正確.") commandEnum = Util.ChannelType[command.upper()] result = ChannelUtil.removeChannel(ctx.guild.id, ctx.channel.id, commandEnum) if result: print( f"Success!: remove channel {ctx.channel.name} for '{commandEnum.name}'." ) else: print( f"FAILED!!: cannot remove channel {ctx.channel.name} for command '{commandEnum.name}'." )
def remove_ignore_xp_channel(self, guild_id: int, channel_id: int): ChannelUtil.removeChannel(guild_id, channel_id, Util.ChannelType.IGNORE_XP) self.__ignoreXpChannel = ChannelUtil.getXPIgnoredChannels()