async def get_list_embed(self, ctx, expanded=False): staff = is_staff(ctx) list_embed = Embed(title="Categories", bot=self.bot, user=ctx.author) list_embed.set_author(name=f"Use {ctx.prefix}help [Command/Category]") await list_embed.set_requested_by_footer() for name, cog in self.bot.cogs.items(): if name == "Admin" or name == "Help": continue if not cog.get_commands(): continue commands = [] for command in cog.get_commands(): if has_is_staff(command) and not staff: continue if hasattr(command, "commands") and expanded: sub_cmds = [command.name for command in command.commands if not has_is_staff(command) or staff] if sub_cmds: commands.append(f"`{command.name}` *({'*, *'.join(sub_cmds)})*") else: commands.append(f"`{command.name}`") else: commands.append(f"`{command.name}`") list_embed.add_field(name=name, value=", ".join(commands), inline=False) list_embed.add_field(name="Links", value="[Contribute](https://discord.gg/zqRsduD2JN) | [Vote](https://top.gg/bot/630106665387032576/vote) | [Invite the Bot to your server](https://discordapp.com/oauth2/authorize?client_id=630106665387032576&scope=bot%20applications.commands&permissions=8) | [Support Server](https://discord.gg/7fPv2uY2Tf) | [Todos](https://trello.com/b/2yBAtx82/skybot-rewrite) | [GitHub repo](https://github.com/Skybot-dev/Skybot-rewrite)", inline=False) return list_embed
async def s_info(self, ctx): """Info|Returns some server information.|""" embed = Embed().make_emb(title="Guild details:", desc="") embed.set_author(name="{} ({})".format(ctx.guild.name, ctx.guild.id)) embed.set_thumbnail(url=ctx.guild.icon_url) embed.add_field(name="Owner", value=ctx.guild.owner, inline=True) embed.add_field(name="Region", value=ctx.guild.region, inline=True) embed.add_field(name="Created at", value=str(ctx.guild.created_at).split('.', 1)[0], inline=True) members = 0 bots = 0 online_members = 0 if not ctx.guild.chunked: await self.bot.request_offline_members(ctx.guild) for member in ctx.guild.members: if member.bot: bots += 1 else: members += 1 status = str(member.status) if not status == "offline": online_members += 1 embed.add_field(name="Members", value=members, inline=True) embed.add_field(name="Bots", value=bots, inline=True) embed.add_field(name="Online members", value=online_members, inline=True) embed.add_field(name="Text channels", value=len(ctx.guild.text_channels), inline=True) embed.add_field(name="Voice channels", value=len(ctx.guild.voice_channels), inline=True) embed.add_field(name="Nitro boost level", value=ctx.guild.premium_tier, inline=True) embed.add_field(name="Members boosting this guild", value=ctx.guild.premium_subscription_count, inline=True) g_boost_stats = "```Emoji limit: {} emojis\nBitrate limit: {} kbps\nFilesize limit: {} MB```" g_boost_stats = g_boost_stats.format( ctx.guild.emoji_limit, int(ctx.guild.bitrate_limit / 1000), int(ctx.guild.filesize_limit / 1048576)) embed.add_field(name="Guild boost stats", value=g_boost_stats, inline=True) emoji_list = await ctx.guild.fetch_emojis() random.shuffle(emoji_list) emoji_string = "" maxlen = len(emoji_list) if maxlen > 20: maxlen = 20 for i in range(0, maxlen): emoji_string += str(emoji_list[i]) if len(emoji_string) > 0: embed.add_field(name="Some emojis", value=emoji_string, inline=True) await ctx.send(embed=embed)
async def check(self, ctx, username: str): name, uuid = await fetch_uuid_uname(username) cs = aiohttp.ClientSession() jerry_resp = await cs.get( "https://raw.githubusercontent.com/skyblockz/pricecheckbot/master/scammer.json" ) jerry_data = await json.loads(await jerry_resp.text()) if not uuid: return await ctx.send("Could not find that username") scammer = await self.bot.scammer_db["scammer_list"].find_one( {"_id": uuid}) if not scammer and uuid not in jerry_data: embed = Embed( title="Safe", description= "This user is not in our database or the jerry database as a scammer. Proceed with caution", bot=self.bot, user=ctx.author) embed.color = 0x00FF00 await embed.set_requested_by_footer() return await ctx.send(embed=embed) if uuid in jerry_data: scam = jerry_data[uuid] embed = Embed( title="SCAMMER", description= "This user has been found on the Jerry Scammer List! Do not trade with this user!" ) embed.add_field(name="Details", value=f"""**Reason:** {scam['reason']} **User's UUID:** {uuid} **DISCLAIMER:** This report has not been handled by us! This report has been provided by SkyBlockZ/Jerry the Skyblock Bot so it may not be 100% accurate!""" ) embed.set_author( name=f"JERRY SCAMMER LIST", url= "https://raw.githubusercontent.com/skyblockz/pricecheckbot/master/scammer.json" ) embed.set_footer(text=f"Added by: {scam[uuid]['operated_staff']}") embed.color = 0xff0000 return await ctx.send(embed=embed) if scammer["report_id"] and not scammer["anonymous"]: report = await self.bot.scammer_db["reports"].find_one( {"_id": scammer["report_id"]}) if not report["anonymous"]: footer_text = f"reported by {report['reporter']}, confirmed by {scammer['mod']}" else: footer_text = f"reported anonymously, confirmed by {scammer['mod']}" else: footer_text = f"added by {scammer['mod']}" embed = discord.Embed(title="SCAMMER", description=scammer["reason"], color=0xff0000).set_footer(text=footer_text) await ctx.send(embed=embed)