mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-04-29 18:13:31 +12:00
always black
This commit is contained in:
parent
7a7f853ccc
commit
6df616443f
|
@ -136,7 +136,7 @@ class Birthday(commands.Cog):
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
@checks.admin_or_permissions(administrator=True)
|
@checks.admin_or_permissions(administrator=True)
|
||||||
async def bdayset(self, ctx):
|
async def bdayset(self, ctx):
|
||||||
""" Manage birthday cog settings """
|
"""Manage birthday cog settings"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@bdayset.command(name="dmmessage")
|
@bdayset.command(name="dmmessage")
|
||||||
|
@ -165,7 +165,7 @@ class Birthday(commands.Cog):
|
||||||
|
|
||||||
@bdayset.command(name="channel")
|
@bdayset.command(name="channel")
|
||||||
async def bdayset_channel(self, ctx, *, channel: discord.TextChannel = None):
|
async def bdayset_channel(self, ctx, *, channel: discord.TextChannel = None):
|
||||||
""" Set channel to send birthday annoucements """
|
"""Set channel to send birthday annoucements"""
|
||||||
if not channel:
|
if not channel:
|
||||||
await self.config.guild(ctx.guild).channel.clear()
|
await self.config.guild(ctx.guild).channel.clear()
|
||||||
else:
|
else:
|
||||||
|
@ -176,7 +176,7 @@ class Birthday(commands.Cog):
|
||||||
@bdayset.command(name="role")
|
@bdayset.command(name="role")
|
||||||
@checks.bot_has_permissions(manage_roles=True)
|
@checks.bot_has_permissions(manage_roles=True)
|
||||||
async def bdayset_role(self, ctx, *, role: discord.Role = None):
|
async def bdayset_role(self, ctx, *, role: discord.Role = None):
|
||||||
""" Set role to give users on their birthday """
|
"""Set role to give users on their birthday"""
|
||||||
if not role:
|
if not role:
|
||||||
await self.config.guild(ctx.guild).role.clear()
|
await self.config.guild(ctx.guild).role.clear()
|
||||||
else:
|
else:
|
||||||
|
@ -187,7 +187,7 @@ class Birthday(commands.Cog):
|
||||||
@commands.group(name="bday")
|
@commands.group(name="bday")
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def bday(self, ctx):
|
async def bday(self, ctx):
|
||||||
""" Manage your birthday """
|
"""Manage your birthday"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@bday.command(name="set")
|
@bday.command(name="set")
|
||||||
|
@ -245,7 +245,7 @@ class Birthday(commands.Cog):
|
||||||
|
|
||||||
@bday.command(name="list")
|
@bday.command(name="list")
|
||||||
async def bday_list(self, ctx):
|
async def bday_list(self, ctx):
|
||||||
""" List birthdays in the server """
|
"""List birthdays in the server"""
|
||||||
embeds = []
|
embeds = []
|
||||||
for member in ctx.guild.members:
|
for member in ctx.guild.members:
|
||||||
bday = await self.config.member(member).birthday()
|
bday = await self.config.member(member).birthday()
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Confession(commands.Cog):
|
||||||
@checks.admin_or_permissions(manage_guild=True)
|
@checks.admin_or_permissions(manage_guild=True)
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def confessionset(self, ctx):
|
async def confessionset(self, ctx):
|
||||||
""" Manage confession rooms """
|
"""Manage confession rooms"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@confessionset.command(name="confess")
|
@confessionset.command(name="confess")
|
||||||
|
|
|
@ -7,7 +7,7 @@ import asyncio
|
||||||
|
|
||||||
|
|
||||||
class Markov(commands.Cog):
|
class Markov(commands.Cog):
|
||||||
""" Generate text based on what your members say per channel"""
|
"""Generate text based on what your members say per channel"""
|
||||||
|
|
||||||
def __init__(self, bot):
|
def __init__(self, bot):
|
||||||
self.bot = bot
|
self.bot = bot
|
||||||
|
@ -40,12 +40,12 @@ class Markov(commands.Cog):
|
||||||
@checks.admin_or_permissions(administrator=True)
|
@checks.admin_or_permissions(administrator=True)
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def markovset(self, ctx):
|
async def markovset(self, ctx):
|
||||||
""" Manage Markov Settings """
|
"""Manage Markov Settings"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@markovset.command(name="clear")
|
@markovset.command(name="clear")
|
||||||
async def markovset_clear(self, ctx, *, channel: discord.TextChannel):
|
async def markovset_clear(self, ctx, *, channel: discord.TextChannel):
|
||||||
""" Clear data for a specific channel """
|
"""Clear data for a specific channel"""
|
||||||
async with self.config.guild(ctx.guild).model() as model:
|
async with self.config.guild(ctx.guild).model() as model:
|
||||||
del self.cache[ctx.guild.id]["model"][str(channel.id)]
|
del self.cache[ctx.guild.id]["model"][str(channel.id)]
|
||||||
try: # possible that channel is cached but not saved yet
|
try: # possible that channel is cached but not saved yet
|
||||||
|
|
|
@ -326,7 +326,7 @@ class PersonalRoles(commands.Cog):
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
@commands.check(has_assigned_role)
|
@commands.check(has_assigned_role)
|
||||||
async def create(self, ctx):
|
async def create(self, ctx):
|
||||||
""" Create personal role if you don't have one already """
|
"""Create personal role if you don't have one already"""
|
||||||
|
|
||||||
role = await self.config.member(ctx.author).role()
|
role = await self.config.member(ctx.author).role()
|
||||||
role = ctx.guild.get_role(role)
|
role = ctx.guild.get_role(role)
|
||||||
|
@ -384,7 +384,7 @@ class PersonalRoles(commands.Cog):
|
||||||
|
|
||||||
@commands.Cog.listener("on_member_remove")
|
@commands.Cog.listener("on_member_remove")
|
||||||
async def remove_role(self, member):
|
async def remove_role(self, member):
|
||||||
""" Delete personal role if member leaves."""
|
"""Delete personal role if member leaves."""
|
||||||
if await self.bot.cog_disabled_in_guild(self, member.guild):
|
if await self.bot.cog_disabled_in_guild(self, member.guild):
|
||||||
return
|
return
|
||||||
role = await self.config.member(member).role()
|
role = await self.config.member(member).role()
|
||||||
|
@ -400,7 +400,7 @@ class PersonalRoles(commands.Cog):
|
||||||
|
|
||||||
@commands.Cog.listener("on_member_update")
|
@commands.Cog.listener("on_member_update")
|
||||||
async def modify_roles(self, before, after):
|
async def modify_roles(self, before, after):
|
||||||
""" Delete personal role if member looses their auto role or looses their personal role """
|
"""Delete personal role if member looses their auto role or looses their personal role"""
|
||||||
if await self.bot.cog_disabled_in_guild(self, after.guild):
|
if await self.bot.cog_disabled_in_guild(self, after.guild):
|
||||||
return
|
return
|
||||||
role = await self.config.member(after).role()
|
role = await self.config.member(after).role()
|
||||||
|
|
|
@ -230,7 +230,7 @@ class RoleManagement(
|
||||||
s_roles.remove(role_id)
|
s_roles.remove(role_id)
|
||||||
|
|
||||||
async def get_cost(self, member: discord.Member, role: discord.Role):
|
async def get_cost(self, member: discord.Member, role: discord.Role):
|
||||||
""" Gets cost of a role for a user """
|
"""Gets cost of a role for a user"""
|
||||||
cost = await self.config.role(role).cost()
|
cost = await self.config.role(role).cost()
|
||||||
free_roles = await self.config.guild(member.guild).free_roles()
|
free_roles = await self.config.guild(member.guild).free_roles()
|
||||||
|
|
||||||
|
@ -275,7 +275,7 @@ class RoleManagement(
|
||||||
@checks.is_owner()
|
@checks.is_owner()
|
||||||
@commands.command(name="rrcleanup", hidden=True)
|
@commands.command(name="rrcleanup", hidden=True)
|
||||||
async def rolemanagementcleanup(self, ctx: GuildContext):
|
async def rolemanagementcleanup(self, ctx: GuildContext):
|
||||||
""" :eyes: """
|
""":eyes:"""
|
||||||
data = await self.config.custom("REACTROLE").all()
|
data = await self.config.custom("REACTROLE").all()
|
||||||
|
|
||||||
key_data = {}
|
key_data = {}
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Rules(commands.Cog):
|
||||||
@commands.group(invoke_without_command=True, aliases=["r"])
|
@commands.group(invoke_without_command=True, aliases=["r"])
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def rule(self, ctx, rule_num: int = None):
|
async def rule(self, ctx, rule_num: int = None):
|
||||||
""" Display guild and channel rules """
|
"""Display guild and channel rules"""
|
||||||
if ctx.invoked_subcommand:
|
if ctx.invoked_subcommand:
|
||||||
return
|
return
|
||||||
elif rule_num is not None:
|
elif rule_num is not None:
|
||||||
|
@ -37,7 +37,7 @@ class Rules(commands.Cog):
|
||||||
|
|
||||||
@rule.command(name="list")
|
@rule.command(name="list")
|
||||||
async def rule_list(self, ctx):
|
async def rule_list(self, ctx):
|
||||||
""" List all guild rules """
|
"""List all guild rules"""
|
||||||
rules = await self.config.guild(ctx.guild).rules()
|
rules = await self.config.guild(ctx.guild).rules()
|
||||||
embeds = []
|
embeds = []
|
||||||
rules_keys = sorted([int(r) for r in rules.keys()])
|
rules_keys = sorted([int(r) for r in rules.keys()])
|
||||||
|
|
|
@ -138,7 +138,7 @@ class Task:
|
||||||
return embed
|
return embed
|
||||||
|
|
||||||
def update_objects(self, bot):
|
def update_objects(self, bot):
|
||||||
""" Updates objects or throws an AttributeError """
|
"""Updates objects or throws an AttributeError"""
|
||||||
guild_id = self.author.guild.id
|
guild_id = self.author.guild.id
|
||||||
author_id = self.author.id
|
author_id = self.author.id
|
||||||
channel_id = self.channel.id
|
channel_id = self.channel.id
|
||||||
|
|
|
@ -415,7 +415,7 @@ class Suggestion(commands.Cog):
|
||||||
@checks.bot_has_permissions(manage_channels=True)
|
@checks.bot_has_permissions(manage_channels=True)
|
||||||
@setsuggest.command(name="setup")
|
@setsuggest.command(name="setup")
|
||||||
async def setsuggest_setup(self, ctx: commands.Context):
|
async def setsuggest_setup(self, ctx: commands.Context):
|
||||||
""" Go through the initial setup process. """
|
"""Go through the initial setup process."""
|
||||||
await self.config.guild(ctx.guild).same.set(False)
|
await self.config.guild(ctx.guild).same.set(False)
|
||||||
await self.config.guild(ctx.guild).suggest_id.set(None)
|
await self.config.guild(ctx.guild).suggest_id.set(None)
|
||||||
await self.config.guild(ctx.guild).approve_id.set(None)
|
await self.config.guild(ctx.guild).approve_id.set(None)
|
||||||
|
@ -568,7 +568,7 @@ class Suggestion(commands.Cog):
|
||||||
@checks.bot_has_permissions(add_reactions=True)
|
@checks.bot_has_permissions(add_reactions=True)
|
||||||
@setsuggest.command(name="upemoji")
|
@setsuggest.command(name="upemoji")
|
||||||
async def setsuggest_upemoji(self, ctx: commands.Context, up_emoji: discord.Emoji = None):
|
async def setsuggest_upemoji(self, ctx: commands.Context, up_emoji: discord.Emoji = None):
|
||||||
""" Set custom reactions emoji instead of ✅. """
|
"""Set custom reactions emoji instead of ✅."""
|
||||||
if not up_emoji:
|
if not up_emoji:
|
||||||
await self.config.guild(ctx.guild).up_emoji.set(None)
|
await self.config.guild(ctx.guild).up_emoji.set(None)
|
||||||
else:
|
else:
|
||||||
|
@ -582,7 +582,7 @@ class Suggestion(commands.Cog):
|
||||||
@checks.bot_has_permissions(add_reactions=True)
|
@checks.bot_has_permissions(add_reactions=True)
|
||||||
@setsuggest.command(name="downemoji")
|
@setsuggest.command(name="downemoji")
|
||||||
async def setsuggest_downemoji(self, ctx: commands.Context, down_emoji: discord.Emoji = None):
|
async def setsuggest_downemoji(self, ctx: commands.Context, down_emoji: discord.Emoji = None):
|
||||||
""" Set custom reactions emoji instead of ❎. """
|
"""Set custom reactions emoji instead of ❎."""
|
||||||
if not down_emoji:
|
if not down_emoji:
|
||||||
await self.config.guild(ctx.guild).up_emoji.set(None)
|
await self.config.guild(ctx.guild).up_emoji.set(None)
|
||||||
else:
|
else:
|
||||||
|
@ -596,7 +596,7 @@ class Suggestion(commands.Cog):
|
||||||
@checks.bot_has_permissions(manage_messages=True)
|
@checks.bot_has_permissions(manage_messages=True)
|
||||||
@setsuggest.command(name="autodelete")
|
@setsuggest.command(name="autodelete")
|
||||||
async def setsuggest_autodelete(self, ctx: commands.Context, on_off: bool = None):
|
async def setsuggest_autodelete(self, ctx: commands.Context, on_off: bool = None):
|
||||||
""" Toggle whether after `[p]suggest`, the bot deletes the message. """
|
"""Toggle whether after `[p]suggest`, the bot deletes the message."""
|
||||||
target_state = on_off if on_off else not (await self.config.guild(ctx.guild).delete_suggest())
|
target_state = on_off if on_off else not (await self.config.guild(ctx.guild).delete_suggest())
|
||||||
await self.config.guild(ctx.guild).delete_suggest.set(target_state)
|
await self.config.guild(ctx.guild).delete_suggest.set(target_state)
|
||||||
if target_state:
|
if target_state:
|
||||||
|
@ -642,7 +642,7 @@ class Suggestion(commands.Cog):
|
||||||
|
|
||||||
@setglobal.command(name="ignore")
|
@setglobal.command(name="ignore")
|
||||||
async def setsuggest_setglobal_ignore(self, ctx: commands.Context, server: discord.Guild = None):
|
async def setsuggest_setglobal_ignore(self, ctx: commands.Context, server: discord.Guild = None):
|
||||||
""" Ignore suggestions from the server. """
|
"""Ignore suggestions from the server."""
|
||||||
if not server:
|
if not server:
|
||||||
server = ctx.guild
|
server = ctx.guild
|
||||||
if server.id not in await self.config.ignore():
|
if server.id not in await self.config.ignore():
|
||||||
|
@ -654,7 +654,7 @@ class Suggestion(commands.Cog):
|
||||||
|
|
||||||
@setglobal.command(name="unignore")
|
@setglobal.command(name="unignore")
|
||||||
async def setsuggest_setglobal_unignore(self, ctx: commands.Context, server: discord.Guild = None):
|
async def setsuggest_setglobal_unignore(self, ctx: commands.Context, server: discord.Guild = None):
|
||||||
""" Remove server from the ignored list. """
|
"""Remove server from the ignored list."""
|
||||||
if not server:
|
if not server:
|
||||||
server = ctx.guild
|
server = ctx.guild
|
||||||
if server.id in await self.config.ignore():
|
if server.id in await self.config.ignore():
|
||||||
|
|
Loading…
Reference in a new issue