async def on_message(self, message: discord.Message):
    if ((not hasattr(message.channel, 'guild')) or (message.channel.guild is None)):
        return
    ctx: commands.Context = (await self.bot.get_context(message))
    guild = message.guild
    is_mod = (Permissioncheckers.get_user_lvl(ctx) >= 2)
    if ((message.author == guild.me) or is_mod or (message.author.id in Configuration.get_var(guild.id, 'IGNORED_USERS'))):
        return
    guilds = Configuration.get_var(message.guild.id, 'INVITE_WHITELIST')
    if (len(guilds) is not 0):
        codes = INVITE_MATCHER.findall(message.content)
        for code in codes:
            try:
                invite: discord.Invite = (await self.bot.get_invite(code))
            except discord.NotFound:
                pass
            except KeyError:
                (await censor(ctx, code, 'DM group'))
            else:
                if ((invite.guild is None) or ((not (invite.guild.id in guilds)) and (invite.guild.id != guild.id))):
                    (await censor(ctx, code, invite.guild.name))
async def on_message(self, message: discord.Message):
    if ((not hasattr(message.channel, 'guild')) or (message.channel.guild is None)):
        return
    ctx: commands.Context = (await self.bot.get_context(message))
    guild = message.guild
    is_mod = (Permissioncheckers.get_user_lvl(ctx) >= 2)
    if ((message.author == guild.me) or is_mod or (message.author.id in Configuration.get_var(guild.id, 'IGNORED_USERS'))):
        return
    guilds = Configuration.get_var(message.guild.id, 'INVITE_WHITELIST')
    if (len(guilds) is not 0):
        codes = INVITE_MATCHER.findall(message.content)
        for code in codes:
            try:
                invite: discord.Invite = (await self.bot.get_invite(code))
            except discord.NotFound:
                pass
            except KeyError:
                (await censor(ctx, code, 'DM group'))
            else:
                if ((invite.guild is None) or ((not (invite.guild.id in guilds)) and (invite.guild.id != guild.id))):
                    (await censor(ctx, code, invite.guild.name))