Esempio n. 1
0
    async def aplicar_aod(self, ctx: Context):
        aod_channel = f"<#{self.bot.setting.chat.get('aod')}>"
        pvm_teacher = f"<@&{self.bot.setting.role.get('pvm_teacher')}>"

        aplicar_message = f"""
Olá! Você aplicou para receber a tag de AoD e participar dos times de Nex: AoD do Clã.

Favor postar uma screenshot que siga ao máximo possível as normas que estão escritas no topo do canal {aod_channel}
Use a imagem a seguir como base:

Inclua na screenshot:
 {right_arrow} Aba de Equipamento que irá usar
 {right_arrow} Aba de Inventário que irá usar
 {right_arrow} Perks de todas as suas Armas e Armaduras que pretende usar
 {right_arrow} Stats
 {right_arrow} Barra de Habilidades no modo de combate que utiliza
 {right_arrow} Nome de usuário in-game

Aguarde uma resposta de um {pvm_teacher}.

***Exemplo(Aplicação para Raids): *** https://i.imgur.com/CMNzquL.png"""

        denied_message = "Fool! Você já tem permissão para ir nos times de AoD!"

        if has_any_role(ctx.author, self.bot.setting.role.get('aod'),
                        self.bot.setting.role.get('aod_learner')):
            return await ctx.send(denied_message)
        return await ctx.send(aplicar_message)
Esempio n. 2
0
    async def aplicar_role(self, ctx: commands.Context):
        if not has_any_role(ctx.author,
                            self.bot.setting.role.get('convidado')):
            return await ctx.send("Fool! Você não é um Convidado!")

        def check(message):
            return message.author == ctx.author

        await ctx.send(
            f"{ctx.author.mention}, por favor me diga o seu nome no jogo.")

        try:
            ingame_name = await self.bot.wait_for('message',
                                                  timeout=180.0,
                                                  check=check)
        except asyncio.TimeoutError:
            return await ctx.send(
                f"{ctx.author.mention}, autenticação Cancelada. Tempo Esgotado."
            )
        await ctx.trigger_typing()
        player = rs3clans.Player(ingame_name.content)
        if not player.exists:
            return await ctx.send(
                f"{ctx.author.mention}, o jogador '{player.name}' não existe.")
        elif player.clan != self.bot.setting.clan_name:
            return await ctx.send(
                f"{ctx.author.mention}, o jogador '{player.name}' não é um membro do Clã Atlantis."
            )
        return await ctx.send(
            f"{ctx.author.mention} um <@&{self.bot.setting.role.get('mod')}> ou "
            f"<@&{self.bot.setting.role.get('admin')}> irá dar seu cargo em breve :)"
        )
Esempio n. 3
0
 async def cog_check(self, ctx: Context):
     """
     Checks if the User running the command is either an Admin or the Bot's Owner
     """
     roles = ['coord_discord', 'org_discord', 'adm_discord']
     roles_ = [self.bot.setting.role.get(role) for role in roles]
     is_owner = await self.bot.is_owner(ctx.author)
     return is_owner or has_any_role(ctx.author, *roles_)
Esempio n. 4
0
async def check_admin_roles(user: discord.Member, settings: Settings,
                            rank: str) -> None:
    """
    Check which Admin rank the User needs to have (if any), and remove any he has
    but shouldn't have
    """

    role_ranks: Dict[str, int] = {
        'Owner': settings.admin_roles().get('rs_owner'),
        'Deputy Owner': settings.admin_roles().get('rs_deputy_owner'),
        'Overseer': settings.admin_roles().get('rs_overseer'),
        'Coordinator': settings.admin_roles().get('rs_coord'),
        'Organiser': settings.admin_roles().get('rs_org'),
        'Admin': settings.admin_roles().get('rs_admin')
    }

    discord_rank: Optional[int] = role_ranks.get(rank)

    if has_any_role(user, discord_rank):
        # User already has necessary rank
        return

    log_channel: discord.TextChannel = user.guild.get_channel(
        697682722503524352)

    embed = discord.Embed(title="Atualização de Rank")
    embed.set_author(name=str(user), icon_url=user.avatar_url)

    role: discord.Role
    for role in user.roles:
        if role.id in role_ranks.values():
            # Remove any Admin roles from user
            await user.remove_roles(role)
            embed.color = discord.Color.dark_red()
            embed.add_field(name="Rank Removido", value=role.mention)
            await log_channel.send(embed=embed)

    # User is not Admin
    if not discord_rank:
        return

    server_rank: discord.Role = user.guild.get_role(discord_rank)

    if server_rank:
        # Give user the necessary rank
        embed.color = discord.Color.green()
        embed.add_field(name="Rank Adicionado", value=server_rank.mention)
        await log_channel.send(embed=embed)
        await user.add_roles(server_rank)
Esempio n. 5
0
    async def aplicar_raids(self, ctx: commands.Context):
        raids_channel = f"<#{self.bot.setting.chat.get('raids')}>"

        aplicar_message = (
            f"Olá! Você aplicou para receber a tag de Raids e participar dos Raids do Clã.\n"
            f"Favor postar uma screenshot que siga ao máximo possível as normas que estão escritas no topo do canal {raids_channel}\n"
            f"Use a imagem a seguir como base: <https://i.imgur.com/M4sU24s.png>\n"
            f"**Inclua na screenshot: **\n"
            f" {right_arrow} Aba de `Equipamento` que irá usar\n"
            f" {right_arrow} Aba de `Inventário` que irá usar\n"
            f" {right_arrow} **`Perks de todas as suas Armas e Armaduras que pretende usar`**\n"
            f" {right_arrow} `Stats`\n"
            f" {right_arrow} `Barra de Habilidades` no modo de combate que utiliza\n"
            f" {right_arrow} `Nome de usuário in-game`\n\n"
            f"Aguarde uma resposta de um <@&{self.bot.setting.role.get('raids_teacher')}>\n\n"
            f"***Exemplo de aplicação:*** https://i.imgur.com/CMNzquL.png")
        denied_message = "Fool! Você já tem permissão para ir Raids!"
        if has_any_role(ctx.author, self.bot.setting.role.get('raids')):
            return await ctx.send(denied_message)
        return await ctx.send(aplicar_message)
Esempio n. 6
0
    async def aplicar_raids(self, ctx: Context):
        denied_message = "Fool! Você já tem permissão para ir Raids!"
        if has_any_role(ctx.author, self.bot.setting.role.get('raids')):
            return await ctx.send(denied_message)

        user = ctx.get_user()
        ingame_name = user.ingame_name

        raids_channel = f"<#{self.bot.setting.chat.get('raids')}>"

        try:
            player = rs3clans.Player(ingame_name)
        except ConnectionError:
            return await ctx.send(
                'Não foi possível acessar a API do Runemetrics no momento, tente novamente mais tarde.'
            )

        if not player.exists:
            return await ctx.send(
                f"{ctx.author.mention}, o jogador '{player.name}' não existe.")
        elif player.clan not in self.bot.setting.clan_names:
            return await ctx.send(
                f"{ctx.author.mention}, o jogador '{player.name}' não é um membro do Clã Atlantis."
            )
        elif player.private_profile:
            return await ctx.send(
                f"{ctx.author.mention}, seu perfil no Runemetrics está privado, por favor o deixe público "
                f"e tente aplicar novamente.")

        emojis = {
            'prayer': '<:prayer:499707566012497921>',
            'herblore': '<:herblore:499707566272544778>',
            'attack': '<:attack:499707565949583391>',
            'invention': '<:invention:499707566419607552>',
            'inventory': '<:inventory:615747024775675925>',
            'full_manual': '<:full_manual:615751745049722880>'
        }

        herb_level = player.skill('herblore').level
        if herb_level < 90:
            await ctx.send(
                f"Ei {ctx.author.mention}, vejo aqui que seu nível de {emojis['herblore']} "
                f"Herbologia é apenas "
                f"**{herb_level}**. Isso é um pouco baixo!\n"
                f"**Irei continuar com o processo de aplicação, mas não será possível te dar permissão para "
                f"participar no momento, aplique novamente quando obter um nível de {emojis['herblore']} "
                f"Herbologia superior a "
                f"90**, falta apenas **{5_346_332 - player.skill('herblore').exp:,.0f}** de Exp!"
            )
        elif 96 > herb_level >= 90:
            await ctx.send(
                f"Ei {ctx.author.mention}, vejo aqui que seu nível de {emojis['herblore']} "
                f"Herbologia é **{herb_level}**. "
                f"Isso é suficiente para fazer Poções de sobrecarregamento (Overloads), mas "
                f"apenas usando Boosts, caso já não tenha, faça alguns usando o seguinte "
                f"boost (ou outro como Pulse Cores) <https://rs.wiki/Spicy_stew>"
            )

        prayer_level = player.skill('prayer').level
        left_to_95 = 8_771_558 - player.skill('prayer').exp

        if prayer_level < 95:
            d_bones_price = await self.get_price(536)
            d_bones_exp = 252
            d_bones_till_99 = int(left_to_95 / d_bones_exp)

            f_bones_price = await self.get_price(18832)
            frost_bones_exp = 630
            f_bones_till_99 = int(left_to_95 / frost_bones_exp)

            gp_emoji = "<:coins:573305319661240340>"

            await ctx.send(
                f"Ei {ctx.author.mention}, vejo aqui que seu nível de {emojis['prayer']} Oração é "
                f"apenas **{prayer_level}**. Isso é um pouco baixo!\n"
                f"Mas tudo bem, falta apenas **{int(left_to_95):,.0f}** de Exp para o nível 95. Com esse nível você "
                f"irá poder usar as segundas melhores Maldições de aumento de dano. Há diversas formas de você "
                f"alcançar o nível 95. Veja algumas abaixo:\n"
                f"• {int(left_to_95 / d_bones_exp):,.0f} Ossos de Dragão no Altar de Casa sem nenhum Boost "
                f"({gp_emoji} {int(d_bones_till_99 * d_bones_price):,.0f})\n"
                f"• {int(left_to_95 / frost_bones_exp):,.0f} Ossos de Dragão Gelado no Altar de Casa sem nenhum Boost "
                f"({gp_emoji} {int(f_bones_till_99 * f_bones_price):,.0f})\n")

        embed = discord.Embed(
            title="Aplicação para Raids",
            description=
            f"Olá! Você aplicou para receber o cargo <@&{self.bot.setting.role.get('raids')}> para "
            f"participar dos Raids do Clã.",
            color=discord.Color.blue())

        nb_space = '\u200B'

        embed.set_thumbnail(url="https://i.imgur.com/2HPEdiz.png")

        embed.add_field(
            name=
            f"{nb_space}\nPor favor postar uma ou mais screenshots com os itens abaixo. "
            f"(pode enviar uma de cada vez)",
            value=
            f"• {emojis['attack']} Equipamento (Arma/Armadura/Acessórios/Switches etc.)\n"
            f"• {emojis['inventory']} Inventário\n"
            f"• {emojis['invention']} Perks de Arma, Armadura, Escudo e Switches que irá usar\n\n",
            inline=False)

        perks_pocketbook = 'https://rspocketbook.com/rs_pocketbook.pdf#page=6'
        embed.add_field(
            name=f"{nb_space}\nLinks Úteis",
            value=
            f"• {emojis['full_manual']} [Exemplos de Barras de Habilidade](https://imgur.com/a/XKzqyFs)\n"
            f"• {emojis['invention']} [Melhores Perks e como os obter]({perks_pocketbook})\n"
            f"• [Exemplo de Aplicação](https://i.imgur.com/CMNzquL.png)\n"
            f"• Guia de Yakamaru: <#{self.bot.setting.chat.get('guia_yaka')}>\n\n",
            inline=False)

        seconds_till_raids = time_till_raids(
            self.bot.setting.raids_start_date())
        raids_diff = datetime.timedelta(seconds=seconds_till_raids)

        days = raids_diff.days
        hours = raids_diff.seconds // 3600
        minutes = (raids_diff.seconds // 60) % 60

        embed.add_field(
            name=f"{nb_space}\nInformações sobre os Times",
            value=f"Os times de Raids acontecem a cada 2 Dias.\n**A próxima "
            f"notificação de Raids será em {days} Dia(s), {hours} Hora(s) e "
            f"{minutes} Minuto(s)**.\n\nPara participar basta digitar **`in raids`** no canal "
            f"<#{self.bot.setting.chat.get('raids_chat')}> após a notificação do Bot, e ele irá o colocar "
            f"no time automaticamente, caso o time já esteja cheio, ele te colocará como substituto até que "
            f"abra alguma vaga. Caso aconteça, ele irá te notificar.\n\n1 hora após o Bot ter iniciado o time "
            f"irá começar o Raids no jogo, não chegue atrasado. Mais informações no canal {raids_channel}.",
            inline=False)
        await ctx.send(
            embed=embed,
            content=f"<@&{self.bot.setting.role.get('pvm_teacher')}>")
Esempio n. 7
0
async def manage_team(team_id: str, client, message: discord.Message, mode: str) -> None:
    """
    Manages a join or leave for a Team

    mode: can be 'join' or 'leave'
    """
    with client.db_session() as session:
        try:
            team: Team = session.query(Team).filter_by(team_id=team_id).first()
            if not team:
                raise TeamNotFoundError
            if int(team.invite_channel_id) != message.channel.id:
                raise WrongChannelError
            await message.delete()
            current_players = session.query(Player).filter_by(team=team.id)
            substitutes = session.query(Player).filter_by(team=team.id, substitute=True)
            invite_channel: discord.TextChannel = client.get_channel(int(team.invite_channel_id))
            team_channel: discord.TextChannel = client.get_channel(int(team.team_channel_id))
            if not invite_channel or not team_channel:
                return await delete_team(session, team, client)
            try:
                team_message = await team_channel.fetch_message(int(team.team_message_id))
            except discord.errors.NotFound:
                return await delete_team(session, team, client)

            text = ''
            no_perm_embed = None

            if mode == 'join':
                team_role = None if not team.role else int(team.role)
                secondary_team_role = None if not team.role_secondary else int(team.role_secondary)

                has_main = has_any_role(message.author, team_role)  # Has main role requirement
                has_secondary = has_any_role(message.author, secondary_team_role)  # Has secondary role requirement
                has_any = has_any_role(message.author, team_role, secondary_team_role)  # Has either or both
                # Has only secondary requirement
                is_secondary = True if (has_secondary and not has_main) else False

                if is_secondary:
                    _, is_team_full = secondary_full(team, session)
                else:
                    is_team_full = is_full(team, session)

                if in_team(message.author.id, team, session):
                    text = 'já está no time'
                elif has_any or not team_role:
                    add_to_team(message.author, team, substitute=is_team_full, secondary=is_secondary, session=session)
                    text = 'entrou ***como substituto*** no time' if is_team_full else 'entrou no time'
                else:
                    description = f"{message.author.mention}, você precisa ter o cargo <@&{team.role}>"
                    if team.role_secondary:
                        description = f"{description} ou o cargo <@&{team.role_secondary}>"
                    description = (f"{description} para entrar no Time '{team.title}' "
                                   f"({current_players.count() - substitutes.count()}/{team.size})\n"
                                   f"(*`{message.content}`*)")
                    no_perm_embed = discord.Embed(
                        title=f"__Permissões insuficientes__",
                        description=description,
                        color=discord.Color.dark_red()
                    )

            elif mode == 'leave':
                if in_team(message.author.id, team, session):
                    text = 'saiu do time'
                    substitute: Player = first_substitute(team, session, message.author.id)
                    is_substitute = session.query(Player).filter_by(
                        player_id=str(message.author.id), team=team.id
                    ).first().substitute
                    # If the person leaving is not a substitute and there is one available, then
                    # make that substitute not be a substitute anymore
                    if substitute and not is_substitute:
                        if substitute.secondary and secondary_full(team, session)[1]:
                            pass
                        else:
                            substitute.substitute = False
                            session.commit()
                            _text = (f"<@{substitute.player_id}> não é mais um substituto do time "
                                     f"**[{team.title}]({team_message.jump_url})** "
                                     f"({current_players.count() - substitutes.count() - 1}/{team.size})")
                            embed = discord.Embed(title='', description=_text, color=discord.Color.green())
                            msg = await invite_channel.send(content=f"<@{substitute.player_id}>", embed=embed)
                            session.add(BotMessage(message_id=msg.id, team=team.id))
                    remove_from_team(message.author.id, team, session)
                else:
                    text = 'já não estava no time'
            if no_perm_embed:
                sent_message = await invite_channel.send(embed=no_perm_embed)
            else:
                _text = (f"{message.author.mention} {text} **[{team.title}]({team_message.jump_url})** "
                         f"({current_players.count() - substitutes.count()}/{team.size})\n\n *`{message.content}`*")
                if mode == 'leave':
                    embed_color = discord.Color.red()
                else:
                    embed_color = discord.Color.green()
                embed = discord.Embed(title='', description=_text, color=embed_color)
                embed.set_author(name=message.author.display_name, icon_url=message.author.avatar_url)
                sent_message = await invite_channel.send(embed=embed)

            session.add(BotMessage(message_id=sent_message.id, team=team.id))
            session.commit()

            try:
                await update_team_message(team_message, team, client.setting.prefix, session)
            except discord.errors.NotFound:
                session.delete(team)
                session.commit()

        except TeamNotFoundError:
            raise TeamNotFoundError
        except WrongChannelError:
            raise WrongChannelError
        except Exception as e:
            await client.send_logs(e, traceback.format_exc())
Esempio n. 8
0
    async def amigo_secreto(self, ctx: Context):
        dev = self.bot.get_user(self.bot.setting.developer_id)
        await dev.send(f'{ctx.author} está se inscrevendo no amigo secreto.')

        with self.bot.db_session() as session:
            state = session.query(AmigoSecretoState).first()

            if not state:
                state = AmigoSecretoState(activated=False)
                session.add(state)
                session.commit()

            if not state.activated:
                return await ctx.send(
                    f"{ctx.author.mention}, o Amigo Secreto do Atlantis ainda não está ativo."
                )

            session.expunge(state)

        user = ctx.get_user()

        if not user:
            raise Exception('Varíavel \'user\' é None')

        atlantis = self.bot.get_guild(self.bot.setting.server_id)
        member = atlantis.get_member(ctx.author.id)

        if not member:
            return await ctx.send(
                f"{ctx.author.mention}, é necessário estar no Servidor do Atlantis "
                f"para participar do Amigo Secreto\nhttps://discord.me/atlantis"
            )

        allowed_role_list = ['membro', 'mod_trial', 'mod', 'mod+', 'admin']
        allowed_roles = [
            self.bot.setting.role.get(role) for role in allowed_role_list
        ]

        if not has_any_role(member, *allowed_roles):
            return await ctx.send(
                f"{ctx.author.mention}, você precisa ser um Membro do Clã para participar do Amigo Secreto."
            )

        with self.bot.db_session() as session:
            exists = session.query(AmigoSecretoPerson).filter_by(
                user_id=user.id).first()

            if exists:
                session.close()
                await ctx.send(
                    f"{ctx.author.mention}, você já está cadastrado no Amigo Secreto!"
                )
                return await dev.send(
                    f'{ctx.author}: Inscrição cancelada. Já está no Amigo Secreto.'
                )

            session.add(AmigoSecretoPerson(user_id=user.id))
            session.commit()

            await dev.send(
                f'{ctx.author} foi cadastrado no Amigo Secreto com sucesso ({user})'
            )

            if state.end_date:
                minus_two_days = state.end_date - timedelta(days=2)
                end_date = f"no dia {minus_two_days.strftime('%d/%m')}"
            else:
                end_date = "quando os Amigos Secretos forem sorteados!"

            return await ctx.send(
                f"{ctx.author.mention}, você foi cadastrado no Amigo Secreto do Atlantis com sucesso! :)\n"
                f"Uma mensagem será enviada pra você no privado do Discord com o nome do seu Amigo Secreto {end_date}"
            )
Esempio n. 9
0
    async def amigo_secreto(self, ctx: commands.Context):
        dev = self.bot.get_user(self.bot.setting.developer_id)
        await dev.send(f'{ctx.author} está se inscrevendo no amigo secreto.')
        with self.bot.db_session() as session:
            state = session.query(AmigoSecretoState).first()
            if not state:
                state = AmigoSecretoState(activated=False)
                session.add(state)
                session.commit()
            current_state = state.activated
        if not current_state:
            return await ctx.send(f"{ctx.author.mention}, o Amigo Secreto do Atlantis ainda não está ativo.")

        atlantis = self.bot.get_guild(self.bot.setting.server_id)
        member = atlantis.get_member(ctx.author.id)

        if not member:
            return await ctx.send(
                f"{ctx.author.mention}, é necessário estar no Servidor do Atlantis "
                f"para participar do Amigo Secreto\nhttps://discord.me/atlantis"
            )

        allowed_roles = ['membro', 'mod_trial', 'mod', 'mod+', 'admin']
        allowed_roles = [self.bot.setting.role.get(role) for role in allowed_roles]
        if not has_any_role(member, *allowed_roles):
            return await ctx.send(
                f"{ctx.author.mention}, você precisa ser um Membro do Clã para participar do Amigo Secreto."
            )

        # Só aceitar respostas de quem iniciou o comando
        def check(message):
            return message.author == ctx.author

        await ctx.send(f"{ctx.author.mention}, digite o seu nome in-game.")
        try:
            ingame_name_message = await self.bot.wait_for('message', timeout=60.0, check=check)
        except asyncio.TimeoutError:

            await ctx.send(f"{ctx.author.mention}, entrada cancelada. Tempo expirado.")
            return await dev.send(f'{ctx.author}: Inscrição cancelada. Tempo expirado.')
        try:
            player = rs3clans.Player(ingame_name_message.content)
        except ConnectionError:
            await ctx.send(
                f"{ctx.author.mention}, erro ao se conectar com a API da Jagex. Tente novamente mais tarde :("
            )
            return await dev.send(f'{ctx.author}: Inscrição cancelada. Erro na API da Jagex.')

        if player.clan != 'Atlantis':
            await ctx.send(
                f"{ctx.author.mention}, você precisa ser um membro do Clã para participar do Amigo Secreto."
            )
            return await dev.send(f'{ctx.author}: Inscrição cancelada. Não é do clã ({player.name})')

        with self.bot.db_session() as session:
            exists = session.query(AmigoSecretoPerson).filter(
                AmigoSecretoPerson.discord_id == str(ctx.author.id)).first()
            if exists:
                session.close()
                await ctx.send(f"{ctx.author.mention}, você já está cadastrado no Amigo Secreto!")
                return await dev.send(f'{ctx.author}: Inscrição cancelada. Já está no Amigo Secreto.')
            session.add(AmigoSecretoPerson(
                discord_id=str(ctx.author.id),
                ingame_name=str(player.name),
                discord_name=str(ctx.author)
            ))
            session.commit()

        await dev.send(f'{ctx.author} foi cadastrado no Amigo Secreto com sucesso ({player.name})')

        return await ctx.send(
            f"{ctx.author.mention}, você foi cadastrado no Amigo Secreto do Atlantis com sucesso! :)\n"
            f"Uma mensagem será enviada pra você no privado do Discord com o nome do seu Amigo Secreto no dia 21/12"
        )
Esempio n. 10
0
    async def on_message(self, message: discord.Message):
        """
        This event triggers on every message received by the bot. Including one's that it sent itself.
        If you wish to have multiple event listeners they can be added in other cogs. All on_message listeners should
        always ignore bots.
        """
        if message.author.bot:
            if self.setting.mode == 'prod':
                if message.content == 'HECK YES!':
                    return await message.channel.send('HECK NO!')
                if self.user.mention in message.content:
                    return await message.channel.send(
                        'What did you say about me you little *****?!')
            return

        # If in development environment only accept answers in dev server and channel
        if self.setting.mode == 'dev':
            if not message.guild:
                if message.author.id != self.setting.developer_id:
                    return
            elif message.guild.id != self.setting.dev_guild and message.channel.id != 488106800655106058:
                return

        membro = self.setting.role.get('membro')
        convidado = self.setting.role.get('convidado')
        unauthorized_mentions = [
            '@everyone', '@here', f"<@&{membro}>", f"<@&{convidado}>"
        ]
        if any(mention in message.content
               for mention in unauthorized_mentions):
            if has_any_role(message.author, membro, convidado):
                embed = discord.Embed(
                    title="__Ei__",
                    description=separator,
                    color=discord.Color.dark_red(),
                )
                embed.add_field(
                    name=
                    f"Por favor não utilize as seguintes menções sem permissão para tal:",
                    value=f"<@&{membro}> - <@&{convidado}> - @everyone - @here",
                    inline=False)
                embed.set_author(
                    name="Administração",
                    icon_url="http://www.runeclan.com/images/ranks/1.png")
                embed.set_thumbnail(
                    url=
                    f"http://services.runescape.com/m=avatar-rs/{self.setting.clan_name}/clanmotif.png"
                )
                embed.set_footer(
                    text=
                    "Nosso servidor abriga uma quantidade muito grande de pessoas, "
                    "tenha bom senso ao utilizar uma menção que irá notificar centenas de pessoas."
                )
                print(
                    f'> {message.author} used a not allowed mention '
                    f'in channel #{message.channel} at {datetime.datetime.now()}'
                )
                print(f"Content:\n<\n{message.content}\n>")
                await message.delete()
                return await message.channel.send(
                    content=message.author.mention, embed=embed)

        # Replace old Rs Wikia links to the new Rs Wiki links
        if 'http' in message.content and 'runescape.fandom.com/wiki' in message.content:
            urls = re.findall(r"http\S+", message.content)
            formatted_urls = []
            for url in urls:
                if 'runescape.fandom.com/wiki' in url:
                    url = url.replace('runescape.fandom.com/wiki/',
                                      'rs.wiki/w/')
                    formatted_urls.append(url)

            formatted_urls_string = ''
            for url in formatted_urls:
                formatted_urls_string += f'- ***<{url}>***\n'

            plural = 's' if len(formatted_urls) > 1 else ''
            await message.channel.send(
                f'Olá, parece que você usou um ou mais links para a antiga Wiki do RuneScape!'
                f'\n\n'
                f'A wiki antiga não é mais suportada e está muito desatualizada. '
                f'Ao invés do{plural} link{plural} que você enviou, utilize o{plural} link{plural} abaixo:\n\n'
                f'{formatted_urls_string}')
        # Checks for 'in {number}' or 'out {number}' in message, for team join/leave commands (case-insensitive)
        team_join = re.search(r'(^in |^out )\d+|(^in raids)|(^out raids)',
                              message.content,
                              flags=re.IGNORECASE)
        if team_join:
            team_join = team_join.group()
            team_id = re.findall(r'\d+|raids', team_join, flags=re.IGNORECASE)
            team_id = ''.join(team_id).lower()
            mode = 'join' if 'in' in team_join.lower() else 'leave'
            try:
                await manage_team(team_id=team_id,
                                  client=self,
                                  message=message,
                                  mode=mode)
                return
            except TeamNotFoundError:
                return await message.channel.send(
                    f"Time com ID '{team_id}' não existe.")
            except WrongChannelError:
                return await message.channel.send(
                    f"Você não pode entrar nesse time por esse canal.")
            except Exception as e:
                msg = 'entrar em' if mode == 'join' else 'sair de'
                return await message.channel.send(
                    f"Erro inesperado ao tentar {msg} time. Favor reportar o erro para @NRiver#2263: {e}"
                )
        await self.process_commands(message)