示例#1
0
    async def about(self, ctx):
        """ This is the 'about the bot' command. """
        description = dedent(f"""\
                             A ~~shit~~ fun bot that was thrown together by a team of complete nincompoops.
                             In definitely no particular order:\n
                            {', '.join([self.bot.get_user(i).__str__() for i in self.bot.owner_ids])}
                             """)
        # uniq_mem_count = set(
        #     member for member in guild.members if not member.bot for guild in self.bot.guilds) #! TODO fix set comp
        uniq_mem_count = set()
        for guild in self.bot.guilds:
            for member in guild.members:
                if not member.bot:
                    uniq_mem_count.add(member)
        
        # {member for member in ctx.bot.get_all_members() if not member.bot}

        embed = BetterEmbed(title=f"About {ctx.guild.me.display_name}")
        embed.description = description
        embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
        embed.add_field(name="Current guilds",
                        value=f'{len(self.bot.guilds):,}')
        embed.add_field(name="Total fleshy people being memed",
                        value=f'{len(uniq_mem_count):,}')
        await ctx.send(embed=embed)
示例#2
0
    async def about(self, ctx):
        """ This is the 'about the bot' command. """
        description = dedent("""\
                             A ~~shit~~ fun bot that was thrown together by a team of complete nincompoops.
                             In definitely no particular order:\n
                             『 Moogs 』#2009, MrSnek#3442, nickofolas#0066 and Umbra#0009
                             """)
        # uniq_mem_count = set(
        #     member for member in guild.members if not member.bot for guild in self.bot.guilds) #! TODO fix set comp
        uniq_mem_count = set()
        for guild in self.bot.guilds:
            for member in guild.members:
                if not member.bot:
                    uniq_mem_count.add(member)

        # {member for member in ctx.bot.get_all_members() if not member.bot}

        embed = BetterEmbed(title=f"About {ctx.guild.me.display_name}")
        embed.description = description
        embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
        embed.add_field(name="Current guilds",
                        value=len(self.bot.guilds),
                        inline=True)
        embed.add_field(name="Total fleshy people being memed",
                        value=len(uniq_mem_count))
        await ctx.send(embed=embed)
示例#3
0
    async def _check_bal(self, ctx: NewCtx, target: Optional[discord.Member]):
        """"""
        user_id = getattr(target, 'id', None) or ctx.author.id
        target = target or ctx.author

        query = "SELECT * FROM game_data WHERE user_id=$1;"
        result = await self.bot.pool.fetchrow(query, user_id)
        if result:
            e = BetterEmbed(title=target.display_name)
            e.add_field(name=f"Your currently have {result['amount']} <:peepee:712691831703601223>.",
                        value='\u200b')
            e.description = f"Wins : {result['wins']}\nLosses : {result['losses']}"
            e.set_author(name=target.display_name, icon_url=str(target.avatar_url))
            return await ctx.send(embed=e)
        else:
            await ctx.send("Yoink hasn't seen you before, wait one.")
            query = "INSERT INTO game_data (user_id, wins, losses, amount)" \
                    "VALUES ($1, $2, $3, $4);"
            await self.bot.pool.execute(query, user_id, 0, 0, 150)
            e = BetterEmbed(title=target.display_name)
            e.add_field(name = f"Your currently have 150 <:peepee:712691831703601223>.",
                        value = '\u200b')
            e.description = f"Wins : 0\nLosses : 0"
            e.set_author(name = target.display_name, icon_url = str(target.avatar_url))
            return await ctx.send(embed = e)
示例#4
0
    async def about(self, ctx: NewCtx):
        """ This is the 'about the bot' command. """
        # Github id of the contributors and their corresponding discord id
        DISCORD_GIT_ACCOUNTS = {
            64285270: 361158149371199488,
            16031716: 155863164544614402,
            4181102: 273035520840564736,
            54324533: 737985288605007953,
            60761231: 723268667579826267,
        }

        contributors = ""
        for contributor in await self.get_profiles():
            if contributor["type"] == "Anonymous":
                contributor["login"] = contributor["name"]
                discord_profile = "unknown"
            else:
                discord_profile = DISCORD_GIT_ACCOUNTS.get(
                    contributor["id"], "unkown")
                if discord_profile != "unknown":
                    discord_profile = self.bot.get_user(discord_profile)
            contributors += f"{contributor['login']}({str(discord_profile)}): \
                            **{contributor['contributions']}** commits.\n"

        uniq_mem_count = set()
        for guild in self.bot.guilds:
            for member in guild.members:
                if not member.bot:
                    uniq_mem_count.add(
                        member)  # can't we just filter bot.users there ?

        embed = BetterEmbed(title=f"About {ctx.guild.me.display_name}")
        embed.description = "A ~~shit~~ fun bot that was thrown together by a team of complete nincompoops."
        embed.set_author(name=ctx.me.display_name, icon_url=ctx.me.avatar_url)
        embed.add_field(name="Contributors", value=contributors, inline=False)
        embed.add_field(name="Current guilds",
                        value=f'{len(self.bot.guilds):,}',
                        inline=False)
        embed.add_field(name="Total fleshy people being memed",
                        value=f'{len(uniq_mem_count):,}',
                        inline=False)
        embed.add_field(name='Come check out our source at ;',
                        value='https://github.com/uYert/yert',
                        inline=False)
        await ctx.send(embed=embed)