mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
Update dependencies (#2148)
Core dependencies: - discord.py: Rapptz/discord.py@00a659c6 -> Rapptz/discord.py@00a659c6 - multidict: 4.4.0 -> 4.4.2 [docs] - pyparsing: 2.2.0 -> 2.2.1 - sphinx: 1.7.8 -> 1.7.9 [test] - pytest: 3.7.4 -> 3.8.1 [style] - toml: 0.9.4 -> 0.9.6 ---- I've also replaced usages of `discord.utils.get(guild.roles, id=id)` with the new O(1) `guild.get_role(id)` method. Signed-off-by: Toby <tobyharradine@gmail.com>
This commit is contained in:
@@ -10,8 +10,8 @@ def mod_or_voice_permissions(**perms):
|
||||
# Author is bot owner or guild owner
|
||||
return True
|
||||
|
||||
admin_role = discord.utils.get(guild.roles, id=await ctx.bot.db.guild(guild).admin_role())
|
||||
mod_role = discord.utils.get(guild.roles, id=await ctx.bot.db.guild(guild).mod_role())
|
||||
admin_role = guild.get_role(await ctx.bot.db.guild(guild).admin_role())
|
||||
mod_role = guild.get_role(await ctx.bot.db.guild(guild).mod_role())
|
||||
|
||||
if admin_role in author.roles or mod_role in author.roles:
|
||||
return True
|
||||
@@ -35,7 +35,7 @@ def admin_or_voice_permissions(**perms):
|
||||
guild = ctx.guild
|
||||
if await ctx.bot.is_owner(author) or guild.owner == author:
|
||||
return True
|
||||
admin_role = discord.utils.get(guild.roles, id=await ctx.bot.db.guild(guild).admin_role())
|
||||
admin_role = guild.get_role(await ctx.bot.db.guild(guild).admin_role())
|
||||
if admin_role in author.roles:
|
||||
return True
|
||||
for vc in guild.voice_channels:
|
||||
|
||||
Reference in New Issue
Block a user