mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Replace isMe with isOwner to allow other people to debug their own bot
This commit is contained in:
parent
e3c0d2b444
commit
7118a80d5d
2 changed files with 9 additions and 8 deletions
|
|
@ -8,22 +8,23 @@ import requests
|
|||
from functions.database import currency
|
||||
|
||||
|
||||
# Checks if caller of a command is me
|
||||
def isMe(ctx):
|
||||
return str(ctx.author.id) == constants.myId
|
||||
# Checks if caller of a command is the owner of the bot
|
||||
async def isMe(ctx):
|
||||
# return str(ctx.author.id) == constants.myId
|
||||
return await ctx.bot.is_owner(ctx.author)
|
||||
|
||||
|
||||
# Checks if the caller of a command is an admin
|
||||
def isMod(ctx):
|
||||
async def isMod(ctx):
|
||||
if ctx.guild is None:
|
||||
return isMe(ctx)
|
||||
return await isMe(ctx)
|
||||
|
||||
return ctx.author.id in constants.mods[ctx.guild.id]
|
||||
|
||||
|
||||
# Checks if a command is allowed to be used in this channel
|
||||
def allowedChannels(ctx):
|
||||
return isMe(ctx) or ctx.channel.type == discord.ChannelType.private or int(ctx.channel.id) in constants.allowedChannels.values()
|
||||
async def allowedChannels(ctx):
|
||||
return (await isMe(ctx)) or ctx.channel.type == discord.ChannelType.private or int(ctx.channel.id) in constants.allowedChannels.values()
|
||||
|
||||
|
||||
# TODO find a better way to check for legit links because reddit posts return a 502
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue