Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
# Conflicts:
#	restricts/restricts.py
  • Loading branch information
ctin committed Dec 2, 2018
2 parents b9bb11c + 4b15c3d commit fe5813e
Show file tree
Hide file tree
Showing 13 changed files with 388 additions and 176 deletions.
4 changes: 4 additions & 0 deletions README.md
@@ -1,3 +1,7 @@
[![Discord](https://img.shields.io/discord/221158719025709056.svg?style=for-the-badge)](https://discord.me/fixator10)
[![Discord](https://img.shields.io/badge/Red-DiscordBot-red.svg?style=for-the-badge)](https://github.com/Cog-Creators/Red-DiscordBot)
[![CodeFactor](https://www.codefactor.io/repository/github/fixator10/fixator10-cogs/badge?style=for-the-badge)](https://www.codefactor.io/repository/github/fixator10/fixator10-cogs)

# Fixator10-Cogs
Cogs from my edition of DiNitride's selfbot and moar

Expand Down
2 changes: 1 addition & 1 deletion adminutils/adminutils.py
Expand Up @@ -22,7 +22,7 @@


class AdminUtils:
def __init__(self, bot: discord.Client):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.base_api_url = "https://discordapp.com/api/oauth2/authorize?"
self.session = aiohttp.ClientSession(loop=self.bot.loop)
Expand Down
7 changes: 2 additions & 5 deletions datautils/datautils.py
Expand Up @@ -22,14 +22,11 @@ def get_rgb_from_int(rgb_int):


def bool_emojify(bool_var: bool) -> str:
if bool_var:
return "✔"
else:
return "❌"
return "✔" if bool_var else "❌"


class DataUtils:
def __init__(self, bot: discord.Client):
def __init__(self, bot: commands.Bot):
self.bot = bot

@commands.command(pass_context=True)
Expand Down
4 changes: 2 additions & 2 deletions godvilledata/godvilledata.py
Expand Up @@ -70,8 +70,8 @@ async def godville(self, *, godname: str):
text += "{}: {}\n".format(profile_replacements[key], value)
elif key == "pet":
text += "Питомец:\n"
for key, value in profile["pet"].items():
text += " {}: {}\n".format(pet_replacements[key], value)
for petfield, petdata in profile["pet"].items():
text += " {}: {}\n".format(pet_replacements[petfield], petdata)
await self.bot.say(text_header + chat.box(text))


Expand Down
7 changes: 2 additions & 5 deletions holidays/holidays.py
Expand Up @@ -11,16 +11,13 @@


def bool_emojify(bool_var: bool) -> str:
if bool_var:
return "✅"
else:
return "❎"
return "✅" if bool_var else "❎"


class Holidays:
"""Check holidays for this month"""

def __init__(self, bot):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=self.bot.loop)
self.config_file = "data/holidays/config.json"
Expand Down
2 changes: 1 addition & 1 deletion memegen/memegen.py
Expand Up @@ -11,7 +11,7 @@
class MemeGen:
"""Make memes with bot!"""

def __init__(self, bot):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.session = aiohttp.ClientSession(loop=self.bot.loop)

Expand Down
23 changes: 10 additions & 13 deletions moreutils/moreutils.py
Expand Up @@ -50,10 +50,7 @@ def rgb_to_cmyk(r, g, b):


def bool_emojify(bool_var: bool) -> str:
if bool_var:
return "✔"
else:
return "❌"
return "✔" if bool_var else "❌"


class CustomChecks:
Expand All @@ -69,7 +66,7 @@ def predicate(ctx):


class MoreUtils:
def __init__(self, bot: discord.Client):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.config_file = "data/moreutils/config.json"
self.config = dataIO.load_json(self.config_file)
Expand Down Expand Up @@ -266,14 +263,14 @@ async def color(self, ctx, color: discord.Color):
await self.bot.say(embed=em)
else:
await self.bot.say("```\n" +
"Provided HEX: " + color +
"\nRGB: " + str(colorrgb) +
"\nCMYK: " + str(colorcmyk) +
"\nHSV: " + str(colorhsv) +
"\nHLS: " + str(colorhls) +
"\nYIQ: " + str(coloryiq) +
"\nint: " + str(colorint) +
"```")
"Provided HEX: " + color +
"\nRGB: " + str(colorrgb) +
"\nCMYK: " + str(colorcmyk) +
"\nHSV: " + str(colorhsv) +
"\nHLS: " + str(colorhls) +
"\nYIQ: " + str(coloryiq) +
"\nint: " + str(colorint) +
"```")

@commands.command(pass_context=True, no_pm=True)
async def someone(self, ctx, *, text: str = None):
Expand Down
12 changes: 6 additions & 6 deletions personalroles/personalroles.py
Expand Up @@ -35,7 +35,7 @@ def predicate(ctx: commands.Context):
class PersonalRoles:
"""Assign and edit personal roles"""

def __init__(self, bot: discord.Client):
def __init__(self, bot: commands.Bot):
self.bot = bot
self.config_file = "data/personalroles/config.json"
self.config = dataIO.load_json(self.config_file)
Expand Down Expand Up @@ -72,15 +72,15 @@ async def unassign(self, ctx, *, user: discord.Member):

@myrole.command(pass_context=True, no_pm=True, hidden=True)
@checks.admin_or_permissions(manage_roles=True)
async def unassignid(self, ctx, *, id: str):
async def unassignid(self, ctx, *, userid: str):
"""Unassign personal role from someone by ID"""
sv = ctx.message.server.id
if sv not in self.config or id not in self.config[sv]["users"]:
await self.bot.say("Can't find {} in assigned roles list.".format(id))
if sv not in self.config or userid not in self.config[sv]["users"]:
await self.bot.say("Can't find {} in assigned roles list.".format(userid))
return
del self.config[sv]["users"][id]
del self.config[sv]["users"][userid]
dataIO.save_json(self.config_file, self.config)
await self.bot.say("Ok. I just removed {} from assigned roles list.".format(id))
await self.bot.say("Ok. I just removed {} from assigned roles list.".format(userid))

@myrole.command(pass_context=True, no_pm=True, name="list")
@checks.admin_or_permissions(manage_roles=True)
Expand Down

0 comments on commit fe5813e

Please sign in to comment.