|
|
@ -65,6 +65,49 @@ class Info(Cog):
|
|
|
|
|
|
|
|
|
|
|
|
await self.bot.generate_embed(ctx, desc=f"Pong! **{round(self.bot.latency * 1000)}ms**")
|
|
|
|
await self.bot.generate_embed(ctx, desc=f"Pong! **{round(self.bot.latency * 1000)}ms**")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="permissions", aliases=["perms"], usage="`[member|role]`")
|
|
|
|
|
|
|
|
@guild_only()
|
|
|
|
|
|
|
|
@bot_has_permissions(embed_links=True, add_reactions=True)
|
|
|
|
|
|
|
|
async def perms(self, ctx, *, item: Optional[Union[Member, Role]]):
|
|
|
|
|
|
|
|
"""View all permissions for any Member/Role!"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Defaults to author if no argument is given
|
|
|
|
|
|
|
|
item = item if item else ctx.author
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if isinstance(item, Member):
|
|
|
|
|
|
|
|
# Iterating through list of perms
|
|
|
|
|
|
|
|
perms = [f"{perm.title().replace('_', ' ')}: {self.bot.tick if value else self.bot.cross}" for perm, value
|
|
|
|
|
|
|
|
in item.guild_permissions]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
# Iterating through list of perms
|
|
|
|
|
|
|
|
perms = [f"{perm.title().replace('_', ' ')}: {self.bot.tick if value else self.bot.cross}" for perm, value
|
|
|
|
|
|
|
|
in item.permissions]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
middle = len(perms) // 2
|
|
|
|
|
|
|
|
f_half = perms[:middle]
|
|
|
|
|
|
|
|
s_half = perms[middle:]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
first_page = Embed(description=f"**Item:** {item}",
|
|
|
|
|
|
|
|
colour=self.bot.admin_colour,
|
|
|
|
|
|
|
|
timestamp=datetime.datetime.utcnow())
|
|
|
|
|
|
|
|
first_page.set_footer(text=f"ID: {item.id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
second_page = Embed(description=f"**Item:** {item}",
|
|
|
|
|
|
|
|
colour=self.bot.admin_colour,
|
|
|
|
|
|
|
|
timestamp=datetime.datetime.utcnow())
|
|
|
|
|
|
|
|
second_page.set_footer(text=f"ID: {item.id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add permissions to both of the embeds
|
|
|
|
|
|
|
|
first = add_perms(first_page, f_half)
|
|
|
|
|
|
|
|
second = add_perms(second_page, s_half)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get the permissions of the channel
|
|
|
|
|
|
|
|
perms = ctx.guild.me.permissions_in(ctx.message.channel)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
menu = SimpleMenu(0, item, perms, [first, second], self)
|
|
|
|
|
|
|
|
await menu.start(ctx)
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="roleinfo", aliases=["ri"])
|
|
|
|
@command(name="roleinfo", aliases=["ri"])
|
|
|
|
@guild_only()
|
|
|
|
@guild_only()
|
|
|
|
async def role_info(self, ctx, *, role: Role):
|
|
|
|
async def role_info(self, ctx, *, role: Role):
|
|
|
@ -81,7 +124,7 @@ class Info(Cog):
|
|
|
|
member = string_list(role.members, 30, "Member")
|
|
|
|
member = string_list(role.members, 30, "Member")
|
|
|
|
|
|
|
|
|
|
|
|
# Using emotes to represent bools
|
|
|
|
# Using emotes to represent bools
|
|
|
|
mentionable = self.bot.tick if role.mention else self.bot.cross
|
|
|
|
mentionable = self.bot.tick if role.mentionable else self.bot.cross
|
|
|
|
hoisted = self.bot.tick if role.hoist else self.bot.cross
|
|
|
|
hoisted = self.bot.tick if role.hoist else self.bot.cross
|
|
|
|
managed = self.bot.tick if role.managed else self.bot.cross
|
|
|
|
managed = self.bot.tick if role.managed else self.bot.cross
|
|
|
|
|
|
|
|
|
|
|
@ -121,49 +164,6 @@ class Info(Cog):
|
|
|
|
|
|
|
|
|
|
|
|
await ctx.send(embed=embed)
|
|
|
|
await ctx.send(embed=embed)
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="permissions", aliases=["perms"], usage="`[Member|Role]`")
|
|
|
|
|
|
|
|
@guild_only()
|
|
|
|
|
|
|
|
@bot_has_permissions(embed_links=True, add_reactions=True)
|
|
|
|
|
|
|
|
async def perms(self, ctx, *, item: Optional[Union[Member, Role]]):
|
|
|
|
|
|
|
|
"""View all permissions for any Member/Role!"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Defaults to author if no argument is given
|
|
|
|
|
|
|
|
item = item if item else ctx.author
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if isinstance(item, Member):
|
|
|
|
|
|
|
|
# Iterating through list of perms
|
|
|
|
|
|
|
|
perms = [f"{perm.title().replace('_', ' ')}: {self.bot.tick if value else self.bot.cross}" for perm, value
|
|
|
|
|
|
|
|
in item.guild_permissions]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
# Iterating through list of perms
|
|
|
|
|
|
|
|
perms = [f"{perm.title().replace('_', ' ')}: {self.bot.tick if value else self.bot.cross}" for perm, value
|
|
|
|
|
|
|
|
in item.permissions]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
middle = len(perms) // 2
|
|
|
|
|
|
|
|
f_half = perms[:middle]
|
|
|
|
|
|
|
|
s_half = perms[middle:]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
first_page = Embed(description=f"**Item:** {item}",
|
|
|
|
|
|
|
|
colour=self.bot.admin_colour,
|
|
|
|
|
|
|
|
timestamp=datetime.datetime.utcnow())
|
|
|
|
|
|
|
|
first_page.set_footer(text=f"ID: {item.id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
second_page = Embed(description=f"**Item:** {item}",
|
|
|
|
|
|
|
|
colour=self.bot.admin_colour,
|
|
|
|
|
|
|
|
timestamp=datetime.datetime.utcnow())
|
|
|
|
|
|
|
|
second_page.set_footer(text=f"ID: {item.id}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Add permissions to both of the embeds
|
|
|
|
|
|
|
|
first = add_perms(first_page, f_half)
|
|
|
|
|
|
|
|
second = add_perms(second_page, s_half)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get the permissions of the channel
|
|
|
|
|
|
|
|
perms = ctx.guild.me.permissions_in(ctx.message.channel)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
menu = SimpleMenu(0, item, perms, [first, second], self)
|
|
|
|
|
|
|
|
await menu.start(ctx)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="rolelist", aliases=["rl"])
|
|
|
|
@command(name="rolelist", aliases=["rl"])
|
|
|
|
@guild_only()
|
|
|
|
@guild_only()
|
|
|
|
async def role_list(self, ctx):
|
|
|
|
async def role_list(self, ctx):
|
|
|
@ -347,38 +347,6 @@ class Info(Cog):
|
|
|
|
|
|
|
|
|
|
|
|
await ctx.send(embed=embed)
|
|
|
|
await ctx.send(embed=embed)
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="source")
|
|
|
|
|
|
|
|
@bot_has_permissions(embed_links=True)
|
|
|
|
|
|
|
|
async def _bot_source(self, ctx):
|
|
|
|
|
|
|
|
"""Link to the source code for Enso!"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
embed = Embed(title=f"<:github:741000905364603010> Source Code | Ensō~Chan {self.bot.version}",
|
|
|
|
|
|
|
|
description="**Click above me to view my source code!**",
|
|
|
|
|
|
|
|
url="https://github.com/sgoudham/Enso-Bot",
|
|
|
|
|
|
|
|
colour=self.bot.admin_colour,
|
|
|
|
|
|
|
|
timestamp=datetime.datetime.utcnow())
|
|
|
|
|
|
|
|
embed.set_thumbnail(url=self.bot.user.avatar_url)
|
|
|
|
|
|
|
|
embed.add_field(name="Developer", value=f"{self.bot.hammyMention} | Hamothy#5619", inline=False)
|
|
|
|
|
|
|
|
embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await ctx.send(embed=embed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="vote", aliases=["upvote"])
|
|
|
|
|
|
|
|
async def upvote(self, ctx):
|
|
|
|
|
|
|
|
"""Upvote the bot on top.gg!"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
desc = "Click the link above to upvote me!\nIt would greatly help me out as it allows the bot to be " \
|
|
|
|
|
|
|
|
"noticed more on the website!\nIt's free and takes a maximum of 30 seconds to do. Thanks so much!"
|
|
|
|
|
|
|
|
embed = Embed(title="Upvote me on top.gg!",
|
|
|
|
|
|
|
|
description=desc,
|
|
|
|
|
|
|
|
url="https://top.gg/bot/716701699145728094/vote",
|
|
|
|
|
|
|
|
colour=self.bot.random_colour(),
|
|
|
|
|
|
|
|
timestamp=datetime.datetime.utcnow())
|
|
|
|
|
|
|
|
embed.set_thumbnail(url=self.bot.user.avatar_url)
|
|
|
|
|
|
|
|
embed.add_field(name="Developer", value=f"{self.bot.hammyMention} | Hamothy#5619", inline=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await ctx.send(embed=embed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@command(name="about")
|
|
|
|
@command(name="about")
|
|
|
|
@bot_has_permissions(embed_links=True)
|
|
|
|
@bot_has_permissions(embed_links=True)
|
|
|
|
async def checking_bot_stats(self, ctx):
|
|
|
|
async def checking_bot_stats(self, ctx):
|
|
|
|