mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 09:56:05 -05:00
[V3/Misc] Spelling, Grammar, and doc string fixes. (#1747)
* Update streams.py * Update filter.py * Update permissions.py * Update customcom.py * Update image.py * Update trivia.py * Update warnings.py
This commit is contained in:
@@ -39,7 +39,7 @@ class Permissions:
|
||||
|
||||
def add_check(self, check_obj: object, before_or_after: str):
|
||||
"""
|
||||
adds a check to the check ordering
|
||||
Adds a check to the check ordering
|
||||
|
||||
checks should be a function taking 2 arguments:
|
||||
ctx: commands.Context
|
||||
@@ -73,7 +73,7 @@ class Permissions:
|
||||
|
||||
def remove_check(self, check_obj: object, before_or_after: str):
|
||||
"""
|
||||
removes a previously registered check object
|
||||
Removes a previously registered check object
|
||||
|
||||
3rd party cogs should keep a copy of of any checks they registered
|
||||
and deregister then on unload
|
||||
@@ -206,10 +206,10 @@ class Permissions:
|
||||
"\n"
|
||||
"1. Rules about a user.\n"
|
||||
"2. Rules about the voice channel a user is in.\n"
|
||||
"3. Rules about the text channel a command was issued in\n"
|
||||
"3. Rules about the text channel a command was issued in.\n"
|
||||
"4. Rules about a role the user has "
|
||||
"(The highest role they have with a rule will be used)\n"
|
||||
"5. Rules about the guild a user is in (Owner level only)"
|
||||
"(The highest role they have with a rule will be used).\n"
|
||||
"5. Rules about the guild a user is in (Owner level only)."
|
||||
"\n\nFor more details, please read the official documentation."
|
||||
)
|
||||
|
||||
@@ -254,13 +254,13 @@ class Permissions:
|
||||
Take a YAML file upload to set permissions from
|
||||
"""
|
||||
if not ctx.message.attachments:
|
||||
return await ctx.send(_("You must upload a file"))
|
||||
return await ctx.send(_("You must upload a file."))
|
||||
|
||||
try:
|
||||
await yamlset_acl(ctx, config=self.config.owner_models, update=False)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return await ctx.send(_("Inalid syntax"))
|
||||
return await ctx.send(_("Invalid syntax."))
|
||||
else:
|
||||
await ctx.send(_("Rules set."))
|
||||
|
||||
@@ -280,13 +280,13 @@ class Permissions:
|
||||
Take a YAML file upload to set permissions from
|
||||
"""
|
||||
if not ctx.message.attachments:
|
||||
return await ctx.send(_("You must upload a file"))
|
||||
return await ctx.send(_("You must upload a file."))
|
||||
|
||||
try:
|
||||
await yamlset_acl(ctx, config=self.config.guild(ctx.guild).owner_models, update=False)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return await ctx.send(_("Inalid syntax"))
|
||||
return await ctx.send(_("Invalid syntax."))
|
||||
else:
|
||||
await ctx.send(_("Rules set."))
|
||||
|
||||
@@ -309,13 +309,13 @@ class Permissions:
|
||||
Use this to not lose existing rules
|
||||
"""
|
||||
if not ctx.message.attachments:
|
||||
return await ctx.send(_("You must upload a file"))
|
||||
return await ctx.send(_("You must upload a file."))
|
||||
|
||||
try:
|
||||
await yamlset_acl(ctx, config=self.config.guild(ctx.guild).owner_models, update=True)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return await ctx.send(_("Inalid syntax"))
|
||||
return await ctx.send(_("Invalid syntax."))
|
||||
else:
|
||||
await ctx.send(_("Rules set."))
|
||||
|
||||
@@ -328,13 +328,13 @@ class Permissions:
|
||||
Use this to not lose existing rules
|
||||
"""
|
||||
if not ctx.message.attachments:
|
||||
return await ctx.send(_("You must upload a file"))
|
||||
return await ctx.send(_("You must upload a file."))
|
||||
|
||||
try:
|
||||
await yamlset_acl(ctx, config=self.config.owner_models, update=True)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return await ctx.send(_("Inalid syntax"))
|
||||
return await ctx.send(_("Invalid syntax."))
|
||||
else:
|
||||
await ctx.send(_("Rules set."))
|
||||
|
||||
@@ -348,7 +348,7 @@ class Permissions:
|
||||
who_or_what: str,
|
||||
):
|
||||
"""
|
||||
adds something to the rules
|
||||
Adds something to the rules
|
||||
|
||||
allow_or_deny: "allow" or "deny", depending on the rule to modify
|
||||
|
||||
@@ -363,7 +363,7 @@ class Permissions:
|
||||
"""
|
||||
obj = self.find_object_uniquely(who_or_what)
|
||||
if not obj:
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention"))
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention."))
|
||||
model_type, type_name = cog_or_command
|
||||
async with self.config.owner_models() as models:
|
||||
data = {k: v for k, v in models.items()}
|
||||
@@ -392,7 +392,7 @@ class Permissions:
|
||||
who_or_what: str,
|
||||
):
|
||||
"""
|
||||
adds something to the rules
|
||||
Adds something to the rules
|
||||
|
||||
allow_or_deny: "allow" or "deny", depending on the rule to modify
|
||||
|
||||
@@ -407,7 +407,7 @@ class Permissions:
|
||||
"""
|
||||
obj = self.find_object_uniquely(who_or_what)
|
||||
if not obj:
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention"))
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention."))
|
||||
model_type, type_name = cog_or_command
|
||||
async with self.config.guild(ctx.guild).owner_models() as models:
|
||||
data = {k: v for k, v in models.items()}
|
||||
@@ -450,7 +450,7 @@ class Permissions:
|
||||
"""
|
||||
obj = self.find_object_uniquely(who_or_what)
|
||||
if not obj:
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention"))
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention."))
|
||||
model_type, type_name = cog_or_command
|
||||
async with self.config.owner_models() as models:
|
||||
data = {k: v for k, v in models.items()}
|
||||
@@ -494,7 +494,7 @@ class Permissions:
|
||||
"""
|
||||
obj = self.find_object_uniquely(who_or_what)
|
||||
if not obj:
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention"))
|
||||
return await ctx.send(_("No unique matches. Try using an ID or mention."))
|
||||
model_type, type_name = cog_or_command
|
||||
async with self.config.guild(ctx.guild).owner_models() as models:
|
||||
data = {k: v for k, v in models.items()}
|
||||
@@ -540,7 +540,7 @@ class Permissions:
|
||||
data[model_type][type_name]["default"] = val_to_set
|
||||
|
||||
models.update(data)
|
||||
await ctx.send(_("Defualt set."))
|
||||
await ctx.send(_("Default set."))
|
||||
|
||||
@checks.is_owner()
|
||||
@permissions.command(name="setdefaultglobalrule")
|
||||
@@ -570,7 +570,7 @@ class Permissions:
|
||||
data[model_type][type_name]["default"] = val_to_set
|
||||
|
||||
models.update(data)
|
||||
await ctx.send(_("Defualt set."))
|
||||
await ctx.send(_("Default set."))
|
||||
|
||||
@commands.bot_has_permissions(add_reactions=True)
|
||||
@checks.is_owner()
|
||||
@@ -592,7 +592,7 @@ class Permissions:
|
||||
|
||||
if REACTS.get(str(reaction)):
|
||||
await self.config.owner_models.clear()
|
||||
await ctx.send(_("Global settings cleared"))
|
||||
await ctx.send(_("Global settings cleared."))
|
||||
else:
|
||||
await ctx.send(_("Okay."))
|
||||
|
||||
@@ -617,7 +617,7 @@ class Permissions:
|
||||
|
||||
if REACTS.get(str(reaction)):
|
||||
await self.config.guild(ctx.guild).owner_models.clear()
|
||||
await ctx.send(_("Guild settings cleared"))
|
||||
await ctx.send(_("Guild settings cleared."))
|
||||
else:
|
||||
await ctx.send(_("Okay."))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user