cogs/catalog.py
async def send(self, channel):
        """Sends the message containing the catalog."""
        # Send Images
        if self.type == "Image":
            # only one image to send
            if len(self.content) == 1:
                imagefile = image_to_file(self.content[0])
                return await channel.send(file=imagefile)

            await self.delete_message()  # delete current message

            # Send and add reactions to new image
            imagefile = image_to_file(self.content[self.page])
            self.message = await channel.send(file=imagefile)
            await self.add_reactions(self.image_reactions)

        # Send embeds
        elif self.type == "Embed":
            # Edit or send new message
            if self.message:
                await self.message.edit(embed=self.generate_embed())
            else:
                self.message = await channel.send(embed=self.generate_embed())
                await self.add_reactions(self.embed_reactions)

        # add to catalog instances
        cfg.catalogs[self.channel.id] = self
Sends the message containing the catalog.
Sends the message containing the catalog.
Sends the message containing the catalog .
async def send(self, channel):
        if self.type == "Image":
            if len(self.content) == 1:
                imagefile = image_to_file(self.content[0])
                return await channel.send(file=imagefile)
            await self.delete_message()  
            imagefile = image_to_file(self.content[self.page])
            self.message = await channel.send(file=imagefile)
            await self.add_reactions(self.image_reactions)
        elif self.type == "Embed":
            if self.message:
                await self.message.edit(embed=self.generate_embed())
            else:
                self.message = await channel.send(embed=self.generate_embed())
                await self.add_reactions(self.embed_reactions)
        cfg.catalogs[self.channel.id] = self
async def send ( self , channel ) : if self . type == "Image" : if len ( self . content ) == 1 : imagefile = image_to_file ( self . content [ 0 ] ) return await channel . send ( file = imagefile ) await self . delete_message ( ) imagefile = image_to_file ( self . content [ self . page ] ) self . message = await channel . send ( file = imagefile ) await self . add_reactions ( self . image_reactions ) elif self . type == "Embed" : if self . message : await self . message . edit ( embed = self . generate_embed ( ) ) else : self . message = await channel . send ( embed = self . generate_embed ( ) ) await self . add_reactions ( self . embed_reactions ) cfg . catalogs [ self . channel . id ] = self
Sends the message containing the catalog.
Sends the message containing the catalog .
"""Sends the message containing the catalog.""" # Send Images # only one image to send # delete current message # Send and add reactions to new image # Send embeds # Edit or send new message # add to catalog instances
self
channel