mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-21 18:27:59 -05:00
[V3] Cleanup quotes in cogs (#1782)
* Cleanup quotes in cogs * More quote cleanup that I missed fixed a little bit of grammar here and there as well. * [V3 Warnings] Change allowcustomreasons docstring To help not confuse users who would believe that the command would use allow or disallow. * Run black reformat
This commit is contained in:
@@ -508,9 +508,7 @@ async def set_bank_name(name: str, guild: discord.Guild = None) -> str:
|
||||
elif guild is not None:
|
||||
await _conf.guild(guild).bank_name.set(name)
|
||||
else:
|
||||
raise RuntimeError(
|
||||
"Guild must be provided if setting the name of a guild" "-specific bank."
|
||||
)
|
||||
raise RuntimeError("Guild must be provided if setting the name of a guild-specific bank.")
|
||||
return name
|
||||
|
||||
|
||||
@@ -570,7 +568,7 @@ async def set_currency_name(name: str, guild: discord.Guild = None) -> str:
|
||||
await _conf.guild(guild).currency.set(name)
|
||||
else:
|
||||
raise RuntimeError(
|
||||
"Guild must be provided if setting the currency" " name of a guild-specific bank."
|
||||
"Guild must be provided if setting the currency name of a guild-specific bank."
|
||||
)
|
||||
return name
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ def interactive_config(red, token_set, prefix_set):
|
||||
while not prefix:
|
||||
prefix = input("Prefix> ")
|
||||
if len(prefix) > 10:
|
||||
print("Your prefix seems overly long. Are you sure it " "is correct? (y/n)")
|
||||
print("Your prefix seems overly long. Are you sure that it's correct? (y/n)")
|
||||
if not confirm("> "):
|
||||
prefix = ""
|
||||
if prefix:
|
||||
@@ -72,7 +72,7 @@ def parse_cli_flags(args):
|
||||
parser.add_argument(
|
||||
"--list-instances",
|
||||
action="store_true",
|
||||
help="List all instance names setup " "with 'redbot-setup'",
|
||||
help="List all instance names setup with 'redbot-setup'",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--owner",
|
||||
@@ -117,7 +117,7 @@ def parse_cli_flags(args):
|
||||
parser.add_argument(
|
||||
"--not-bot",
|
||||
action="store_true",
|
||||
help="Specifies if the token used belongs to a bot " "account.",
|
||||
help="Specifies if the token used belongs to a bot account.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--dry-run",
|
||||
@@ -131,12 +131,12 @@ def parse_cli_flags(args):
|
||||
parser.add_argument(
|
||||
"--mentionable",
|
||||
action="store_true",
|
||||
help="Allows mentioning the bot as an alternative " "to using the bot prefix",
|
||||
help="Allows mentioning the bot as an alternative to using the bot prefix",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--rpc",
|
||||
action="store_true",
|
||||
help="Enables the built-in RPC server. Please read the docs" "prior to enabling this!",
|
||||
help="Enables the built-in RPC server. Please read the docs prior to enabling this!",
|
||||
)
|
||||
parser.add_argument(
|
||||
"instance_name", nargs="?", help="Name of the bot instance created during `redbot-setup`."
|
||||
|
||||
@@ -250,7 +250,7 @@ class CogManager:
|
||||
mod = import_module(real_name, package="redbot.cogs")
|
||||
except ImportError as e:
|
||||
raise RuntimeError(
|
||||
"No core cog by the name of '{}' could" "be found.".format(name)
|
||||
"No core cog by the name of '{}' could be found.".format(name)
|
||||
) from e
|
||||
return mod.__spec__
|
||||
|
||||
@@ -342,9 +342,7 @@ class CogManagerUI:
|
||||
Add a path to the list of available cog paths.
|
||||
"""
|
||||
if not path.is_dir():
|
||||
await ctx.send(
|
||||
_("That path does not exist or does not" " point to a valid directory.")
|
||||
)
|
||||
await ctx.send(_("That path does not exist or does not point to a valid directory."))
|
||||
return
|
||||
|
||||
try:
|
||||
@@ -419,7 +417,7 @@ class CogManagerUI:
|
||||
|
||||
install_path = await ctx.bot.cog_mgr.install_path()
|
||||
await ctx.send(
|
||||
_("The bot will install new cogs to the `{}`" " directory.").format(install_path)
|
||||
_("The bot will install new cogs to the `{}` directory.").format(install_path)
|
||||
)
|
||||
|
||||
@commands.command()
|
||||
|
||||
@@ -223,7 +223,7 @@ class Group(Value):
|
||||
identifiers=new_identifiers, default_value=self._defaults[item], driver=self.driver
|
||||
)
|
||||
elif self.force_registration:
|
||||
raise AttributeError("'{}' is not a valid registered Group " "or value.".format(item))
|
||||
raise AttributeError("'{}' is not a valid registered Group or value.".format(item))
|
||||
else:
|
||||
return Value(identifiers=new_identifiers, default_value=None, driver=self.driver)
|
||||
|
||||
@@ -623,9 +623,7 @@ class Config:
|
||||
existing_is_dict = isinstance(_partial[k], dict)
|
||||
if val_is_dict != existing_is_dict:
|
||||
# != is XOR
|
||||
raise KeyError(
|
||||
"You cannot register a Group and a Value under" " the same name."
|
||||
)
|
||||
raise KeyError("You cannot register a Group and a Value under the same name.")
|
||||
if val_is_dict:
|
||||
Config._update_defaults(v, _partial=_partial[k])
|
||||
else:
|
||||
|
||||
@@ -280,7 +280,7 @@ class Core(CoreLogic):
|
||||
embed.add_field(name="About Red", value=about, inline=False)
|
||||
|
||||
embed.set_footer(
|
||||
text="Bringing joy since 02 Jan 2016 (over " "{} days ago!)".format(days_since)
|
||||
text="Bringing joy since 02 Jan 2016 (over {} days ago!)".format(days_since)
|
||||
)
|
||||
try:
|
||||
await ctx.send(embed=embed)
|
||||
@@ -429,7 +429,7 @@ class Core(CoreLogic):
|
||||
author = ctx.author
|
||||
guild = ctx.guild
|
||||
|
||||
await ctx.send("Are you sure you want me to leave this server?" " Type yes to confirm.")
|
||||
await ctx.send("Are you sure you want me to leave this server? Type yes to confirm.")
|
||||
|
||||
def conf_check(m):
|
||||
return m.author == author
|
||||
@@ -555,7 +555,7 @@ class Core(CoreLogic):
|
||||
await ctx.send(formed)
|
||||
|
||||
if failed:
|
||||
fmt = "Failed to reload package{plural} {packs}. Check your " "logs for details"
|
||||
fmt = "Failed to reload package{plural} {packs}. Check your logs for details"
|
||||
formed = self._get_package_strings(failed, fmt)
|
||||
await ctx.send(formed)
|
||||
|
||||
@@ -846,7 +846,7 @@ class Core(CoreLogic):
|
||||
try:
|
||||
await ctx.guild.me.edit(nick=nickname)
|
||||
except discord.Forbidden:
|
||||
await ctx.send(_("I lack the permissions to change my own " "nickname."))
|
||||
await ctx.send(_("I lack the permissions to change my own nickname."))
|
||||
else:
|
||||
await ctx.send("Done.")
|
||||
|
||||
@@ -889,7 +889,7 @@ class Core(CoreLogic):
|
||||
|
||||
for i in range(length):
|
||||
token += random.choice(chars)
|
||||
log.info("{0} ({0.id}) requested to be set as owner." "".format(ctx.author))
|
||||
log.info("{0} ({0.id}) requested to be set as owner.".format(ctx.author))
|
||||
print(_("\nVerification token:"))
|
||||
print(token)
|
||||
|
||||
@@ -1168,7 +1168,7 @@ class Core(CoreLogic):
|
||||
prefixes = await ctx.bot.command_prefix(ctx.bot, fake_message(guild=None))
|
||||
prefix = prefixes[0]
|
||||
|
||||
content = _("Use `{}dm {} <text>` to reply to this user" "").format(prefix, author.id)
|
||||
content = _("Use `{}dm {} <text>` to reply to this user").format(prefix, author.id)
|
||||
|
||||
description = _("Sent by {} {}").format(author, source)
|
||||
|
||||
@@ -1189,7 +1189,7 @@ class Core(CoreLogic):
|
||||
await owner.send(content, embed=e)
|
||||
except discord.InvalidArgument:
|
||||
await ctx.send(
|
||||
_("I cannot send your message, I'm unable to find " "my owner... *sigh*")
|
||||
_("I cannot send your message, I'm unable to find my owner... *sigh*")
|
||||
)
|
||||
except:
|
||||
await ctx.send(_("I'm unable to deliver your message. Sorry."))
|
||||
@@ -1201,7 +1201,7 @@ class Core(CoreLogic):
|
||||
await owner.send("{}\n{}".format(content, box(msg_text)))
|
||||
except discord.InvalidArgument:
|
||||
await ctx.send(
|
||||
_("I cannot send your message, I'm unable to find " "my owner... *sigh*")
|
||||
_("I cannot send your message, I'm unable to find my owner... *sigh*")
|
||||
)
|
||||
except:
|
||||
await ctx.send(_("I'm unable to deliver your message. Sorry."))
|
||||
@@ -1246,7 +1246,7 @@ class Core(CoreLogic):
|
||||
await destination.send(embed=e)
|
||||
except:
|
||||
await ctx.send(
|
||||
_("Sorry, I couldn't deliver your message " "to {}").format(destination)
|
||||
_("Sorry, I couldn't deliver your message to {}").format(destination)
|
||||
)
|
||||
else:
|
||||
await ctx.send(_("Message delivered to {}").format(destination))
|
||||
@@ -1256,7 +1256,7 @@ class Core(CoreLogic):
|
||||
await destination.send("{}\n{}".format(box(response), content))
|
||||
except:
|
||||
await ctx.send(
|
||||
_("Sorry, I couldn't deliver your message " "to {}").format(destination)
|
||||
_("Sorry, I couldn't deliver your message to {}").format(destination)
|
||||
)
|
||||
else:
|
||||
await ctx.send(_("Message delivered to {}").format(destination))
|
||||
|
||||
@@ -74,9 +74,7 @@ def load_basic_configuration(instance_name_: str):
|
||||
|
||||
def _base_data_path() -> Path:
|
||||
if basic_config is None:
|
||||
raise RuntimeError(
|
||||
"You must load the basic config before you" " can get the base data path."
|
||||
)
|
||||
raise RuntimeError("You must load the basic config before you can get the base data path.")
|
||||
path = basic_config["DATA_PATH"]
|
||||
return Path(path).resolve()
|
||||
|
||||
@@ -106,7 +104,7 @@ def cog_data_path(cog_instance=None, raw_name: str = None) -> Path:
|
||||
base_data_path = Path(_base_data_path())
|
||||
except RuntimeError as e:
|
||||
raise RuntimeError(
|
||||
"You must load the basic config before you" " can get the cog data path."
|
||||
"You must load the basic config before you can get the cog data path."
|
||||
) from e
|
||||
cog_path = base_data_path / basic_config["COG_PATH_APPEND"]
|
||||
|
||||
@@ -124,7 +122,7 @@ def core_data_path() -> Path:
|
||||
base_data_path = Path(_base_data_path())
|
||||
except RuntimeError as e:
|
||||
raise RuntimeError(
|
||||
"You must load the basic config before you" " can get the core data path."
|
||||
"You must load the basic config before you can get the core data path."
|
||||
) from e
|
||||
core_path = base_data_path / basic_config["CORE_PATH_APPEND"]
|
||||
core_path.mkdir(exist_ok=True, parents=True)
|
||||
|
||||
@@ -47,9 +47,7 @@ class Dev:
|
||||
"""
|
||||
if e.text is None:
|
||||
return box("{0.__class__.__name__}: {0}".format(e), lang="py")
|
||||
return box(
|
||||
"{0.text}{1:>{0.offset}}\n{2}: {0}" "".format(e, "^", type(e).__name__), lang="py"
|
||||
)
|
||||
return box("{0.text}{1:>{0.offset}}\n{2}: {0}".format(e, "^", type(e).__name__), lang="py")
|
||||
|
||||
@staticmethod
|
||||
def get_pages(msg: str):
|
||||
@@ -209,12 +207,12 @@ class Dev:
|
||||
|
||||
if ctx.channel.id in self.sessions:
|
||||
await ctx.send(
|
||||
_("Already running a REPL session in this channel. " "Exit it with `quit`.")
|
||||
_("Already running a REPL session in this channel. Exit it with `quit`.")
|
||||
)
|
||||
return
|
||||
|
||||
self.sessions.add(ctx.channel.id)
|
||||
await ctx.send(_("Enter code to execute or evaluate." " `exit()` or `quit` to exit."))
|
||||
await ctx.send(_("Enter code to execute or evaluate. `exit()` or `quit` to exit."))
|
||||
|
||||
msg_check = lambda m: (
|
||||
m.author == ctx.author and m.channel == ctx.channel and m.content.startswith("`")
|
||||
|
||||
@@ -78,7 +78,7 @@ class Mongo(BaseDriver):
|
||||
)
|
||||
|
||||
if partial is None:
|
||||
raise KeyError("No matching document was found and Config expects" " a KeyError.")
|
||||
raise KeyError("No matching document was found and Config expects a KeyError.")
|
||||
|
||||
for i in identifiers:
|
||||
partial = partial[i]
|
||||
|
||||
Reference in New Issue
Block a user