async def about(self, ctx):
        """ 關於機器人 """
        ram_usage = self.process.memory_full_info().rss / 1024**2
        avg_members = round(len(self.bot.users) / len(self.bot.guilds))

        embed_colour = discord.Embed.Empty
        if hasattr(ctx, 'guild') and ctx.guild is not None:
            embed_colour = ctx.me.top_role.colour

        embed = discord.Embed(colour=embed_colour)
        embed.set_thumbnail(url=ctx.bot.user.avatar_url)
        embed.add_field(name="Last boot",
                        value=default.timeago(datetime.now() -
                                              self.bot.uptime),
                        inline=True)
        embed.add_field(
            name=f"Developer{'' if len(self.config.owners) == 1 else 's'}",
            value=', '.join(
                [str(self.bot.get_user(x)) for x in self.config.owners]),
            inline=True)
        embed.add_field(name="Library", value="discord.py", inline=True)
        embed.add_field(
            name="Servers",
            value=f"{len(ctx.bot.guilds)} ( avg: {avg_members} users/server )",
            inline=True)
        embed.add_field(name="Commands loaded",
                        value=str(len([x.name for x in self.bot.commands])),
                        inline=True)
        embed.add_field(name="RAM", value=f"{ram_usage:.2f} MB", inline=True)

        await ctx.send(
            content=f"ℹ About **{ctx.bot.user}** | **{self.config.version}**",
            embed=embed)
Esempio n. 2
0
    async def about(self, ctx):
        """ About the bot """
        ramUsage = self.process.memory_full_info().rss / 1024**2
        unique_members = set(self.bot.get_all_members())
        unique_online = sum(1 for m in unique_members if m.status is discord.Status.online)
        unique_offline = sum(1 for m in unique_members if m.status is discord.Status.offline)
        unique_idle = sum(1 for m in unique_members if m.status is discord.Status.idle)
        unique_dnd = sum(1 for m in unique_members if m.status is discord.Status.dnd)
        channel_types = Counter(type(c) for c in self.bot.get_all_channels())
        voice = channel_types[discord.channel.VoiceChannel]
        text = channel_types[discord.channel.TextChannel]

        with open("db/config.json", "r") as f:
            data = json.load(f)

        embed = discord.Embed(colour=self.bot.embed_color)
        #embed.set_thumbnail(url=ctx.bot.user.avatar_url)
        embed.set_author(icon_url=self.bot.user.avatar_url, name=f"{self.bot.user.name}#{self.bot.user.discriminator} | {data['BOT_VERSION']}")
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.dev'), value='Dutchy#6127', inline=True)
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.lib'), value="[Discord.py](https://github.com/Rapptz/discord.py)")
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.cmd_load'), value=len([x.name for x in self.bot.commands]), inline=True)
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.servers'), value=len(self.bot.guilds))
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.system_ram'), value=f"{ramUsage:.2f} MB", inline=True)
        #embed.add_field(name="Commands run", value=self.bot.cmd_count)
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.last_boot'), value=default.timeago(datetime.utcnow() - self.bot.uptime), inline=True)
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.users'), value=f"<:online:313956277808005120>⠀{unique_online} \n"
                            f"<:offline:313956277237710868>⠀{unique_offline} \n"
                            f"<:away:313956277220802560>⠀{unique_idle} \n"
                            f"<:dnd:313956276893646850>⠀{unique_dnd} \n"
                            f"**~~------------------~~**\n"
                            f"{get_text(ctx.guild, 'info', 'info.total')}:⠀{len(unique_members)}\n")
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.chan'), value=f"<:channel:585783907841212418> {text}\n<:voice:585783907673440266> {voice}")
        embed.add_field(name=get_text(ctx.guild, 'info', 'info.created'), value=f"{default.date(self.bot.user.created_at)}\n({default.timeago(datetime.utcnow() - self.bot.user.created_at)})")
        await ctx.send(embed=embed)
Esempio n. 3
0
    async def about(self, ctx):
        """ About the bot """
        ramUsage = self.process.memory_full_info().rss / 1024**2

        embed = discord.Embed(colour=ctx.me.top_role.colour)
        embed.set_thumbnail(url=ctx.bot.user.avatar_url)
        embed.add_field(name="Last boot",
                        value=default.timeago(datetime.now() -
                                              self.bot.uptime),
                        inline=True)
        embed.add_field(
            name=f"Developer{'' if len(self.config.owners) == 1 else 's'}",
            value=', '.join(
                [str(self.bot.get_user(x)) for x in self.config.owners]),
            inline=True)
        embed.add_field(name="Library", value="discord.py", inline=True)
        embed.add_field(name="Commands loaded",
                        value=len([x.name for x in self.bot.commands]),
                        inline=True)
        embed.add_field(name="Servers", value=len(ctx.bot.guilds), inline=True)
        embed.add_field(name="RAM", value=f"{ramUsage:.2f} MB", inline=True)

        await ctx.send(
            content=f"ℹ About **{ctx.bot.user}** | **{repo.version}**",
            embed=embed)
Esempio n. 4
0
    async def aboutbot(self, ctx):
        """ About the bot """
        ram_usage = self.process.memory_full_info().rss / 1024**2
        avg_members = round(len(self.bot.users) / len(self.bot.guilds))

        embed = discord.Embed(colour=ctx.me.top_role.colour)
        embed.set_thumbnail(url=ctx.bot.user.avatar_url)
        embed.add_field(name="Last boot",
                        value=default.timeago(datetime.now() -
                                              self.bot.uptime),
                        inline=True)
        embed.add_field(
            name=f"Developer: Ari Bowe",
            # value=', '.join([str(self.bot.get_user(x)) for x in self.config.owners]),
            inline=True)
        embed.add_field(name="Library", value="discord.py", inline=True)
        embed.add_field(
            name="Servers",
            value=f"{len(ctx.bot.guilds)} ( avg: {avg_members} users/server )",
            inline=True)
        embed.add_field(name="Commands loaded",
                        value=str(len([x.name for x in self.bot.commands])),
                        inline=True)
        embed.add_field(name="RAM", value=f"{ram_usage:.2f} MB", inline=True)

        await ctx.send(
            content=
            f"ℹ About **{ctx.bot.user}** | **{repo.VERSION_DATA['Version']}**",
            embed=embed)
Esempio n. 5
0
    async def info(self, ctx):
        """ Bot bilgilerini gönderir """
        ram_usage = self.process.memory_full_info().rss / 1024**2
        embed_color = discord.Embed.Empty
        if hasattr(ctx, 'guild') and ctx.guild is not None:
            embed_color = ctx.me.top_role.colour

        user_count = len(self.bot.users)
        avgmembers = user_count / len(self.bot.guilds)

        embed = discord.Embed(colour=embed_color)
        embed.set_thumbnail(url=ctx.bot.user.avatar_url)
        embed.add_field(name="Son restart",
                        value=default.timeago(datetime.now() -
                                              self.bot.boot_time),
                        inline=False)
        embed.add_field(name="Server Sayısı",
                        value=f"{len(ctx.bot.guilds)}",
                        inline=False)
        embed.add_field(name="Kullanıcı Sayısı",
                        value=f"{user_count}",
                        inline=False)
        embed.add_field(
            name=f"Geliştirici",
            value=f"{str(self.bot.get_user(self.config.owners[0]))}",
            inline=True)
        embed.add_field(name="Bellek kullanımı",
                        value=f"{ram_usage:.2f} MB",
                        inline=True)

        await ctx.send(
            content=f"**{ctx.bot.user}** | **{self.config.version}**",
            embed=embed)
Esempio n. 6
0
 async def valheim(self, ctx):
     """Gets Valheim server status"""
     print("getting valheim server status:")
     result = subprocess.run([
         'systemctl show -p ActiveState,SubState,ExecMainStartTimestamp --value valheim'
     ],
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE,
                             universal_newlines=True,
                             shell=True)
     print(result.returncode)
     if result.stdout:
         test = result.stdout.splitlines()
         if test[0] != '':
             format_time = Valheim.parse_systemctl_time(test[0])
             format_time = datetime.strptime(format_time,
                                             '%Y-%m-%d %H:%M:%S')
         else:
             test[0] = 'N/A'
         embedColour = discord.Embed.Empty
         if hasattr(ctx, 'guild') and ctx.guild is not None:
             embedColour = ctx.me.top_role.colour
         embed = discord.Embed(colour=embedColour)
         embed.add_field(name="Server State", value=test[2], inline=True)
         embed.add_field(name="Sub State", value=test[1], inline=True)
         embed.add_field(name="Up Time",
                         value=default.timeago(datetime.now() -
                                               format_time))
         await ctx.send(content="**Valheim Server Status**", embed=embed)
     if result.stderr:
         print(f'stderr: {result.stderr}')
         await ctx.send(f'Error retreiving server status')
Esempio n. 7
0
    async def about(self, ctx):

        version = self.bot.version
        channel_types = Counter(type(c) for c in self.bot.get_all_channels())
        voice = channel_types[discord.channel.VoiceChannel]
        text = channel_types[discord.channel.TextChannel]

        te = len([c for c in set(self.bot.walk_commands()) if c.cog_name == "Owner"])
        se = len([c for c in set(self.bot.walk_commands()) if c.cog_name == "Staff"])
        xd = len([c for c in set(self.bot.walk_commands())])
        if await ctx.bot.is_owner(ctx.author):
            ts = 0
        elif await ctx.bot.is_admin(ctx.author):
            ts = te
        elif not await ctx.bot.is_admin(ctx.author):
            ts = te + se
        totcmd = xd - ts

        mems = sum([x.member_count for x in self.bot.guilds])
        website = 'https://dredd-bot.xyz/'
        Moksej = self.bot.get_user(345457928972533773)

        embed = discord.Embed(color=self.bot.settings['colors']['embed_color'])
        embed.set_author(name=_("About {0}").format(self.bot.user), icon_url=self.bot.user.avatar_url)
        embed.description = _("""
Dredd is a bot that will help your server with moderation, provide fun to your members, and much more! The bot is currently running on **V{0}** and is currently maintained.

**Developer:** [{1}](https://discord.com/users/345457928972533773)
**Library & version:** {2} [enhanced discord.py {3}](https://github.com/iDutchy/discord.py)
**Last boot:** {4}
**Created:** {5} ({6})

**Links:**
• [Support server]({7})
• [Bot invite]({8})
• [Website]({17})

**Latest Changes:**
{9}

**Total:**
• Commands: **{10}**
• Members: **{11}**
• Servers: **{12}**
• Channels: {13} **{14}** | {15} **{16}**\n
""").format(version, escape_markdown(str(Moksej), as_needed=False), self.bot.settings['emojis']['misc']['python'], discord.__version__, btime.human_timedelta(self.bot.uptime),
            default.date(self.bot.user.created_at), default.timeago(datetime.utcnow() - self.bot.user.created_at.replace(tzinfo=None)), self.bot.support, self.bot.invite,
            self.get_last_commits(), f'{totcmd:,}', f'{mems:,}', f'{len(self.bot.guilds):,}', self.bot.settings['emojis']['logs']['unlock'], f'{text:,}',
            self.bot.settings['emojis']['logs']['vcunlock'], f'{voice:,}', website)
        embed.set_image(
            url=self.bot.settings['banners']['default'])

        await ctx.send(embed=embed)
Esempio n. 8
0
    async def about(self, ctx):
        """ About the bot """
        ramUsage = self.process.memory_full_info().rss / 1024**2
        avgmembers = round(len(self.bot.users) / len(self.bot.guilds))

        embedColour = discord.Embed.Empty
        if hasattr(ctx, 'guild') and ctx.guild is not None:
            embedColour = ctx.me.top_role.colour

        embed = discord.Embed(colour=embedColour)
        embed.set_thumbnail(url=ctx.bot.user.avatar_url)
        embed.add_field(name="Last boot", value=default.timeago(datetime.now() - self.bot.uptime), inline=True)
        embed.add_field(name="Servers", value=f"{len(ctx.bot.guilds)} ( avg: {avgmembers} users/server )", inline=True)
        embed.add_field(name="Commands loaded", value=len([x.name for x in self.bot.commands]), inline=True)
        embed.add_field(name="RAM", value=f"{ramUsage:.2f} MB", inline=True)

        await ctx.send(content=f"About **{ctx.bot.user}** | **{self.config.version}**", embed=embed)
Esempio n. 9
0
    async def about(self, ctx):
        """ About the bot """
        fuckmenigga = ctx.message.author
        if discord.utils.get(fuckmenigga.roles, name="Muted") != None:
            return
        ramUsage = self.process.memory_full_info().rss / 1024**2
        avgmembers = round(len(self.bot.users) / len(self.bot.guilds))
        uptime = f_time(datetime.now() - self.bot.startup)
        embedColour = ctx.me.top_role.colour

        embed = discord.Embed(colour=embedColour)
        embed.add_field(name="🔌 Last boot",
                        value=default.timeago(datetime.now() -
                                              self.bot.uptime),
                        inline=False)
        embed.add_field(name=u'🕓 Uptime',
                        value=uptime + "\n\u200b",
                        inline=False)
        embed.add_field(
            name=f"⚙ Developer{'' if len(self.config.owners) == 1 else 's'}",
            value=', '.join(
                [str(self.bot.get_user(x)) for x in self.config.owners]),
            inline=True)
        embed.add_field(name="🧬 Library", value="discord.py", inline=True)
        embed.add_field(
            name="⚔️ Servers",
            value=f"{len(ctx.bot.guilds)} ( avg: {avgmembers} users/server )",
            inline=True)
        embed.add_field(name="💾 Commands loaded",
                        value=len([x.name for x in self.bot.commands]),
                        inline=True)
        embed.add_field(name="🔥 RAM", value=f"{ramUsage:.2f} MB", inline=True)
        embed.add_field(name='⏱ Latency',
                        value=f'{round(self.bot.latency * 1000)} ms',
                        inline=True)

        await ctx.send(
            content=f"ℹ About **{ctx.bot.user}** | **{repo.version}**",
            embed=embed)
Esempio n. 10
0
 async def informacje(self, ctx):
     """ Informacje o bocie """
     ramUsage = self.process.memory_full_info().rss / 1024**2
     embed = discord.Embed(colour=ctx.me.top_role.colour)
     embed.set_thumbnail(url=ctx.bot.user.avatar_url)
     embed.add_field(name="Ostatnie uruchomienie",
                     value=default.timeago(datetime.now() -
                                           self.bot.uptime),
                     inline=True)
     embed.add_field(
         name=f"Autor{'' if len(self.config.owners) == 1 else 's'}",
         value=', '.join(
             [str(self.bot.get_user(x)) for x in self.config.owners]),
         inline=True)
     embed.add_field(name="Załadowanych komend",
                     value=len([x.name for x in self.bot.commands]),
                     inline=True)
     embed.add_field(name="Użycie RAM",
                     value=f"{ramUsage:.2f} MB",
                     inline=True)
     await ctx.send(content=f"**Zadymkowicz** | **{repo.version}**",
                    embed=embed)