bot/exts/filter.py
async def notify_mods(
            self,
            event: GuildMessageCreateEvent,
            matching_content: Optional[str],
            type_of_filter: str,
            footer: Optional[str] = None
    ) -> None:
        """Notify moderators when a message filter is triggered."""
        message_channel = self.bot.cache.get_guild_channel(event.message.channel_id)
        user = event.message.author

        channel = self.bot.cache.get_guild_channel(Channels.mod_alerts)

        description = (
            f"**Sent by {user.mention} in {message_channel.mention}**\n"
            f"{'**Filter matching content**:' if matching_content else ''}{matching_content}\n"
            f"**Full message:**\n{event.message.content}"
        )

        embed = hikari.Embed(
            title=f"**Filter triggered:** {type_of_filter}",
            description=description,
            colour=hikari.Color.of((255, 255, 255))
        )
        mods_role = self.bot.cache.get_role(Roles.mods)
        embed.set_footer(text=footer)
        await channel.send(content=mods_role.mention, embed=embed)

        await event.message.delete()
Notify moderators when a message filter is triggered.
Notify moderators when a message filter is triggered.
Notify moderators when a message filter is triggered .
async def notify_mods(
            self,
            event: GuildMessageCreateEvent,
            matching_content: Optional[str],
            type_of_filter: str,
            footer: Optional[str] = None
    ) -> None:
        message_channel = self.bot.cache.get_guild_channel(event.message.channel_id)
        user = event.message.author
        channel = self.bot.cache.get_guild_channel(Channels.mod_alerts)
        description = (
            f"**Sent by {user.mention} in {message_channel.mention}**\n"
            f"{'**Filter matching content**:' if matching_content else ''}{matching_content}\n"
            f"**Full message:**\n{event.message.content}"
        )
        embed = hikari.Embed(
            title=f"**Filter triggered:** {type_of_filter}",
            description=description,
            colour=hikari.Color.of((255, 255, 255))
        )
        mods_role = self.bot.cache.get_role(Roles.mods)
        embed.set_footer(text=footer)
        await channel.send(content=mods_role.mention, embed=embed)
        await event.message.delete()
async def notify_mods ( self , event : GuildMessageCreateEvent , matching_content : Optional [ str ] , type_of_filter : str , footer : Optional [ str ] = None ) -> None : message_channel = self . bot . cache . get_guild_channel ( event . message . channel_id ) user = event . message . author channel = self . bot . cache . get_guild_channel ( Channels . mod_alerts ) description = ( f"**Sent by {user.mention} in {message_channel.mention}**\n" f"{'**Filter matching content**:' if matching_content else ''}{matching_content}\n" f"**Full message:**\n{event.message.content}" ) embed = hikari . Embed ( title = f"**Filter triggered:** {type_of_filter}" , description = description , colour = hikari . Color . of ( ( 255 , 255 , 255 ) ) ) mods_role = self . bot . cache . get_role ( Roles . mods ) embed . set_footer ( text = footer ) await channel . send ( content = mods_role . mention , embed = embed ) await event . message . delete ( )
Notify moderators when a message filter is triggered.
Notify moderators when a message filter is triggered .
"""Notify moderators when a message filter is triggered."""
self
event
GuildMessageCreateEvent
matching_content
Optional[str]
type_of_filter
str
footer
Optional[str]