mirror of
https://github.com/myned/modufur.git
synced 2024-12-24 14:27:27 +00:00
Merge branch 'dev'
This commit is contained in:
commit
bb5860847b
4 changed files with 21 additions and 5 deletions
|
@ -1495,6 +1495,9 @@ class MsG:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
if not tags:
|
||||||
|
raise exc.MissingArgument
|
||||||
|
|
||||||
aliases = {}
|
aliases = {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -1564,6 +1567,9 @@ class MsG:
|
||||||
|
|
||||||
except exc.Abort:
|
except exc.Abort:
|
||||||
await dest.send('**Aborted**')
|
await dest.send('**Aborted**')
|
||||||
|
except exc.MissingArgument:
|
||||||
|
await dest.send('\N{CROSS MARK} **Missing tags**')
|
||||||
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_add_tags.command(name='channel', aliases=['ch', 'c'], brief='@manage_channel@ Add tag(s) to the current channel blacklist (requires manage_channel)', description='Add tag(s) to the current channel blacklist ')
|
@_add_tags.command(name='channel', aliases=['ch', 'c'], brief='@manage_channel@ Add tag(s) to the current channel blacklist (requires manage_channel)', description='Add tag(s) to the current channel blacklist ')
|
||||||
@cmds.has_permissions(manage_channels=True)
|
@cmds.has_permissions(manage_channels=True)
|
||||||
|
@ -1585,6 +1591,9 @@ class MsG:
|
||||||
|
|
||||||
except exc.Abort:
|
except exc.Abort:
|
||||||
await dest.send('**Aborted**')
|
await dest.send('**Aborted**')
|
||||||
|
except exc.MissingArgument:
|
||||||
|
await dest.send('\N{CROSS MARK} **Missing tags**')
|
||||||
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@_add_tags.command(name='me', aliases=['m'])
|
@_add_tags.command(name='me', aliases=['m'])
|
||||||
async def __add_user_tags(self, ctx, *args):
|
async def __add_user_tags(self, ctx, *args):
|
||||||
|
@ -1602,6 +1611,9 @@ class MsG:
|
||||||
|
|
||||||
except exc.Abort:
|
except exc.Abort:
|
||||||
await dest.send('**Aborted**')
|
await dest.send('**Aborted**')
|
||||||
|
except exc.MissingArgument:
|
||||||
|
await dest.send('\N{CROSS MARK} **Missing tags**')
|
||||||
|
await ctx.message.add_reaction('\N{CROSS MARK}')
|
||||||
|
|
||||||
@blacklist.group(name='remove', aliases=['rm', 'r'])
|
@blacklist.group(name='remove', aliases=['rm', 'r'])
|
||||||
async def _remove_tags(self, ctx):
|
async def _remove_tags(self, ctx):
|
||||||
|
|
|
@ -95,7 +95,7 @@ class Bot:
|
||||||
if v:
|
if v:
|
||||||
permissions[member.mention].append(k)
|
permissions[member.mention].append(k)
|
||||||
|
|
||||||
await ctx.send(f'**Permissions:**\n\n{formatter.dict_tostring(permissions, f=False)}')
|
await ctx.send(f'**Permissions:**\n\n{formatter.dict_tostring(permissions, f=False, newline=True)}')
|
||||||
|
|
||||||
@cmds.command(name=',tasks', aliases=[',task'])
|
@cmds.command(name=',tasks', aliases=[',task'])
|
||||||
@cmds.is_owner()
|
@cmds.is_owner()
|
||||||
|
|
|
@ -197,8 +197,8 @@ async def on_command_completion(ctx):
|
||||||
if ctx.guild.id in u.settings['del_ctx'] and ctx.me.permissions_in(ctx.channel).manage_messages and isinstance(ctx.message.channel, d.TextChannel):
|
if ctx.guild.id in u.settings['del_ctx'] and ctx.me.permissions_in(ctx.channel).manage_messages and isinstance(ctx.message.channel, d.TextChannel):
|
||||||
await ctx.message.delete()
|
await ctx.message.delete()
|
||||||
|
|
||||||
with suppress(err.Forbidden):
|
# with suppress(err.Forbidden):
|
||||||
await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
# await ctx.message.add_reaction('\N{WHITE HEAVY CHECK MARK}')
|
||||||
|
|
||||||
for command in ('lastcommand', ',restart', ',die'):
|
for command in ('lastcommand', ',restart', ',die'):
|
||||||
if ctx.command.name == command:
|
if ctx.command.name == command:
|
||||||
|
|
|
@ -20,17 +20,21 @@ def tostring_commas(i):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
|
||||||
def dict_tostring(i, f=True):
|
def dict_tostring(i, f=True, newline=False):
|
||||||
o = ''
|
o = ''
|
||||||
|
|
||||||
if f:
|
if f:
|
||||||
if i:
|
if i:
|
||||||
for k, v in i.items():
|
for k, v in i.items():
|
||||||
o += '**' + k + ':** `' + tostring(v) + '`\n'
|
o += '**' + k + ':** `' + tostring(v) + '`\n'
|
||||||
|
elif newline is True:
|
||||||
|
if i:
|
||||||
|
for k, v in i.items():
|
||||||
|
o += k + ': ```' + tostring(v, newline=newline) + '```\n'
|
||||||
else:
|
else:
|
||||||
if i:
|
if i:
|
||||||
for k, v in i.items():
|
for k, v in i.items():
|
||||||
o += k + ': ```' + tostring(v, newline=True) + '```\n'
|
o += k + ': ```' + tostring(v) + '```\n'
|
||||||
return o
|
return o
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue