Browse Source

Merge branch 'master' into development

development
Roxie Gibson 5 years ago
parent
commit
91b2835116
No known key found for this signature in database
6 changed files with 66 additions and 23 deletions
  1. +2
    -1
      README.md
  2. +1
    -0
      SUPPORTERS.md
  3. +1
    -0
      docs/index.md
  4. +2
    -1
      roxbot/cogs/customcommands.py
  5. +31
    -0
      roxbot/cogs/image.py
  6. +29
    -21
      roxbot/cogs/selfassign.py

+ 2
- 1
README.md View File

@@ -45,7 +45,8 @@ Even if you have only been on this tier for one month, you will show up in this
```
Asuna Gilfoyle
Lo_Fi
Mark Travis
Mark Travis
Lynnesbian
```



+ 1
- 0
SUPPORTERS.md View File

@@ -8,4 +8,5 @@ Even if you have only been on this tier for one month, you will show up in this
Asuna Gilfoyle
Lo_Fi
Mark Travis
Lynnesbian
```

+ 1
- 0
docs/index.md View File

@@ -53,6 +53,7 @@ Even if you have only been on this tier for one month, you will show up in this
Asuna Gilfoyle
Lo_Fi
Mark Travis
Lynnesbian
```



+ 2
- 1
roxbot/cogs/customcommands.py View File

@@ -214,7 +214,8 @@ class CustomCommands(commands.Cog):


CCCommands(name=command, guild_id=ctx.guild.id, output=output, type=command_type)
return await ctx.send(self.OUTPUT_ADD.format(command, output if len(output) > 1 else output[0]))

return await ctx.send(self.OUTPUT_ADD.format(command, output if len(output) > 1 or isinstance(output, dict) else output[0]))

@commands.has_permissions(manage_messages=True)
@custom.command()

+ 31
- 0
roxbot/cogs/image.py View File

@@ -131,6 +131,17 @@ class PrideFlags:
green = (176, 244, 141)
colours = (black, grey, white, green, white, grey, black)
return cls(rows=rows, colours=colours)
@classmethod
def aro(cls):
rows = 5
green = (61, 165, 66)
ltgreen = (167, 212, 121)
white = (255, 255, 255)
grey = (169, 169, 169)
black = (0, 0, 0)
colours = (green, ltgreen, white, grey, black)
return cls(rows=rows, colours=colours)


class ImageEditor(commands.Cog):
@@ -402,6 +413,26 @@ class ImageEditor(commands.Cog):
output = await ctx.send(file=file)
os.remove(file.filename)
await self.image_logging(ctx, output)
@pride.command(aliases=["aro"])
async def aromantic(self, ctx, image: roxbot.converters.AvatarURL = None):
"""Adds a Aromantic Pride Flag filter to the given image
Args:
image: Optional
If nothing, your avatar
Mention a user, their avatar
Provide a URL, that image
Provide an image via upload, that image.
"""
if not image:
image = self.image_lookup(ctx.message)

flag = PrideFlags.aro()
async with ctx.typing():
file = await self.flag_filter("aro", flag, image)
output = await ctx.send(file=file)
os.remove(file.filename)
await self.image_logging(ctx, output)

@commands.command(aliases=["df"])
async def deepfry(self, ctx, image: roxbot.converters.AvatarURL=None):

+ 29
- 21
roxbot/cogs/selfassign.py View File

@@ -71,32 +71,40 @@ class SelfAssign(commands.Cog):
"""
with db_session:
self_assign = SelfAssignSingle.get(guild_id=ctx.guild.id)
if setting == "enable":
if setting == "enable":
with db_session:
self_assign.enabled = True
await ctx.send("'self_assign' was enabled!")
elif setting == "disable":
await ctx.send("'self_assign' was enabled!")

elif setting == "disable":
with db_session:
self_assign.enabled = False
await ctx.send("'self_assign' was disabled :cry:")
elif setting == "add":
try:
await ctx.send("'self_assign' was disabled :cry:")

elif setting == "add":
try:
with db_session:
SelfAssignRoles(role_id=role.id, guild_id=ctx.guild.id)
await ctx.send('Role "{}" added'.format(str(role)))
except AttributeError:
raise commands.BadArgument("Could not find that role.")
except TransactionIntegrityError:
raise commands.BadArgument("{} is already a self-assignable role.".format(role.name))
elif setting == "remove":
try:
return await ctx.send('Role "{}" added'.format(str(role)))
except AttributeError:
raise commands.BadArgument("Could not find that role.")
except TransactionIntegrityError:
raise commands.BadArgument("{} is already a self-assignable role.".format(role.name))

elif setting == "remove":
try:
with db_session:
query = SelfAssignRoles.get(role_id=role.id)
if query:
if query:
with db_session:
query.delete()
return await ctx.send('"{}" has been removed from the self-assignable roles.'.format(str(role)))
else:
return await ctx.send("That role was not in the list.")
except AttributeError:
raise commands.BadArgument("Could not find that role.")
else:
return await ctx.send("No valid option given.")
return await ctx.send('"{}" has been removed from the self-assignable roles.'.format(str(role)))
else:
return await ctx.send("That role was not in the list.")
except AttributeError:
raise commands.BadArgument("Could not find that role.")
else:
return await ctx.send("No valid option given.")

@commands.guild_only()
@commands.command(pass_context=True)

Loading…
Cancel
Save