Пример #1
0
    async def registerchannel(self, ctx, channel: discord.Channel = None):
        if channel is None:
            channel = ctx.message.channel

        _channel = Channel(channel.id)

        if _channel.is_Registered:
            await self.bot.say(self.errors.CHANNEL_ALREADY_IN_DB)
            return
        else:
            _channel.append_channel()

        await self.bot.say(self.msg.CHANNEL_REGISTERED.format(channel.name))
Пример #2
0
    async def registerallchannels(self, ctx, persistence: int):
        await self.bot.say(self.msg.REG_WAIT)
        count = 0
        for channel in ctx.message.server.channels:
            _channel = Channel(channel.id)

            if _channel.is_Registered:
                continue

            _channel.append_channel()
            _channel.set_persistence(persistence)
            count += 1

        if count == 0:
            await self.bot.say(self.msg.NO_CHANNEL_REG)
            return

        await self.bot.say(self.msg.REG_CHAN_SUCC.format(count))