Exemple #1
0
    async def set_topic_channel(self, channel):
        """Set the topic channel for this guild"""
        data.edit(self.guild_id, "music", channel.id, ["topic_id"])

        self.topicchannel = channel
        await self.set_topic(self.topic)

        await channel.trigger_typing()
        embed = ui_embed.topic_update(channel, self.topicchannel)
        await embed.send()
Exemple #2
0
    async def clear_topic_channel(self, channel):
        """Set the topic channel for this guild"""
        try:
            if self.topicchannel:
                await self.topicchannel.edit(topic="")
        except Exception as e:
            logger.exception(e)

        self.topicchannel = None
        logger.debug("Clearing topic channel")

        data.edit(self.guild_id, "music", "", ["topic_id"])

        await channel.trigger_typing()
        embed = ui_embed.topic_update(channel, self.topicchannel)
        await embed.send()
Exemple #3
0
    async def set_topic_channel(self,
                                channel: discord.TextChannel) -> None:
        """Sets the topic channel for this guild.

        Args:
            channel (discord.TextChannel): The channel to set the topic channel to.
        """

        data.edit(self.guild_id, "music", channel.id, ["topic_id"])

        self.topic_channel = channel
        await self.update_topic(self.topic)

        await channel.trigger_typing()
        info_gui = ui_embed.topic_update(channel, self.topic_channel)
        await info_gui.send()
Exemple #4
0
    async def clear_topic_channel(self,
                                  channel: discord.TextChannel) -> None:
        """Clears the topic channel for this guild.

        Args:
            channel (discord.TextChannel): The channel to send updates to.
        """

        try:
            if self.topic_channel:
                await self.topic_channel.edit(topic="")
        except Exception as e:
            logger.exception(e)

        self.topic_channel = None
        logger.debug("Clearing topic channel")

        data.edit(self.guild_id, "music", "", ["topic_id"])

        await channel.trigger_typing()
        info_gui = ui_embed.topic_update(channel, self.topic_channel)
        await info_gui.send()
Exemple #5
0
    def push_topic_channel(self) -> None:
        """Pushes the ID of the chosen channel for topic status updates to the database."""

        data.edit(self.guild_id, "music", self.topic_channel.id, ["topic_channel_id"])
Exemple #6
0
    def push_volume(self) -> None:
        """Pushes the volume setting to the database."""

        data.edit(self.guild_id, "music", self.volume, ["volume"])