mirror of
https://github.com/osmarks/autobotrobot
synced 2025-01-31 09:34:44 +00:00
permissions changes
This commit is contained in:
parent
2f50bdbbde
commit
40b82bd10b
@ -163,7 +163,7 @@ When you want to end a call, use hangup.
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@telephone.command(brief="Generate a webhook")
|
@telephone.command(brief="Generate a webhook")
|
||||||
@commands.check(util.admin_check)
|
@commands.check(util.server_mod_check)
|
||||||
async def init_webhook(self, ctx):
|
async def init_webhook(self, ctx):
|
||||||
webhook = (await ctx.channel.create_webhook(name="ABR webhook", reason=f"requested by {ctx.author.name}")).url
|
webhook = (await ctx.channel.create_webhook(name="ABR webhook", reason=f"requested by {ctx.author.name}")).url
|
||||||
await self.bot.database.execute("INSERT OR REPLACE INTO discord_webhooks VALUES (?, ?)", (ctx.channel.id, webhook))
|
await self.bot.database.execute("INSERT OR REPLACE INTO discord_webhooks VALUES (?, ?)", (ctx.channel.id, webhook))
|
||||||
|
@ -250,7 +250,7 @@ def gen_codeblock(content):
|
|||||||
def json_encode(x): return json.dumps(x, separators=(',', ':'))
|
def json_encode(x): return json.dumps(x, separators=(',', ':'))
|
||||||
|
|
||||||
async def server_mod_check(ctx):
|
async def server_mod_check(ctx):
|
||||||
return ctx.author.permissions_in(ctx.channel).manage_channels or (await ctx.bot.is_owner(ctx.author))
|
return ctx.author.permissions_in(ctx.channel).manage_channels or (await extpriv_check(ctx))
|
||||||
|
|
||||||
async def admin_check(ctx):
|
async def admin_check(ctx):
|
||||||
return await ctx.bot.is_owner(ctx.author)
|
return await ctx.bot.is_owner(ctx.author)
|
||||||
|
Loading…
Reference in New Issue
Block a user