mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -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:
@@ -28,5 +28,5 @@ class SelfRole(commands.Converter):
|
||||
role = await role_converter.convert(ctx, arg)
|
||||
|
||||
if role.id not in selfroles:
|
||||
raise commands.BadArgument("The provided role is not a valid" " selfrole.")
|
||||
raise commands.BadArgument("The provided role is not a valid selfrole.")
|
||||
return role
|
||||
|
||||
@@ -233,9 +233,7 @@ class Alias:
|
||||
|
||||
await self.add_alias(ctx, alias_name, command)
|
||||
|
||||
await ctx.send(
|
||||
_("A new alias with the trigger `{}`" " has been created.").format(alias_name)
|
||||
)
|
||||
await ctx.send(_("A new alias with the trigger `{}` has been created.").format(alias_name))
|
||||
|
||||
@checks.is_owner()
|
||||
@global_.command(name="add")
|
||||
@@ -282,7 +280,7 @@ class Alias:
|
||||
await self.add_alias(ctx, alias_name, command, global_=True)
|
||||
|
||||
await ctx.send(
|
||||
_("A new global alias with the trigger `{}`" " has been created.").format(alias_name)
|
||||
_("A new global alias with the trigger `{}` has been created.").format(alias_name)
|
||||
)
|
||||
|
||||
@alias.command(name="help")
|
||||
@@ -307,9 +305,7 @@ class Alias:
|
||||
|
||||
if is_alias:
|
||||
await ctx.send(
|
||||
_("The `{}` alias will execute the" " command `{}`").format(
|
||||
alias_name, alias.command
|
||||
)
|
||||
_("The `{}` alias will execute the command `{}`").format(alias_name, alias.command)
|
||||
)
|
||||
else:
|
||||
await ctx.send(_("There is no alias with the name `{}`").format(alias_name))
|
||||
@@ -330,7 +326,7 @@ class Alias:
|
||||
|
||||
if await self.delete_alias(ctx, alias_name):
|
||||
await ctx.send(
|
||||
_("Alias with the name `{}` was successfully" " deleted.").format(alias_name)
|
||||
_("Alias with the name `{}` was successfully deleted.").format(alias_name)
|
||||
)
|
||||
else:
|
||||
await ctx.send(_("Alias with name `{}` was not found.").format(alias_name))
|
||||
@@ -350,7 +346,7 @@ class Alias:
|
||||
|
||||
if await self.delete_alias(ctx, alias_name, global_=True):
|
||||
await ctx.send(
|
||||
_("Alias with the name `{}` was successfully" " deleted.").format(alias_name)
|
||||
_("Alias with the name `{}` was successfully deleted.").format(alias_name)
|
||||
)
|
||||
else:
|
||||
await ctx.send(_("Alias with name `{}` was not found.").format(alias_name))
|
||||
|
||||
@@ -12,7 +12,7 @@ import redbot.core
|
||||
log = logging.getLogger("red.audio")
|
||||
|
||||
LAVALINK_DOWNLOAD_URL = (
|
||||
"https://github.com/Cog-Creators/Red-DiscordBot/" "releases/download/{}/Lavalink.jar"
|
||||
"https://github.com/Cog-Creators/Red-DiscordBot/releases/download/{}/Lavalink.jar"
|
||||
).format(redbot.core.__version__)
|
||||
|
||||
LAVALINK_DOWNLOAD_DIR = cog_data_path(raw_name="Audio")
|
||||
|
||||
@@ -76,7 +76,7 @@ class Bank:
|
||||
default_balance = await bank._conf.guild(ctx.guild).default_balance()
|
||||
|
||||
settings = _(
|
||||
"Bank settings:\n\n" "Bank name: {}\n" "Currency: {}\n" "Default balance: {}" ""
|
||||
"Bank settings:\n\nBank name: {}\nCurrency: {}\nDefault balance: {}"
|
||||
).format(bank_name, currency_name, default_balance)
|
||||
await ctx.send(box(settings))
|
||||
await ctx.send_help()
|
||||
|
||||
@@ -139,7 +139,7 @@ class Cleanup:
|
||||
delete_pinned=delete_pinned,
|
||||
)
|
||||
|
||||
reason = "{}({}) deleted {} messages " " containing '{}' in channel {}.".format(
|
||||
reason = "{}({}) deleted {} messages containing '{}' in channel {}.".format(
|
||||
author.name, author.id, len(to_delete), text, channel.id
|
||||
)
|
||||
log.info(reason)
|
||||
@@ -229,7 +229,7 @@ class Cleanup:
|
||||
is_bot = self.bot.user.bot
|
||||
|
||||
if not is_bot:
|
||||
await ctx.send(_("This command can only be used on bots with " "bot accounts."))
|
||||
await ctx.send(_("This command can only be used on bots with bot accounts."))
|
||||
return
|
||||
|
||||
after = await channel.get_message(message_id)
|
||||
@@ -242,7 +242,7 @@ class Cleanup:
|
||||
ctx, channel, 0, limit=None, after=after, delete_pinned=delete_pinned
|
||||
)
|
||||
|
||||
reason = "{}({}) deleted {} messages in channel {}." "".format(
|
||||
reason = "{}({}) deleted {} messages in channel {}.".format(
|
||||
author.name, author.id, len(to_delete), channel.name
|
||||
)
|
||||
log.info(reason)
|
||||
@@ -273,7 +273,7 @@ class Cleanup:
|
||||
)
|
||||
to_delete.append(ctx.message)
|
||||
|
||||
reason = "{}({}) deleted {} messages in channel {}." "".format(
|
||||
reason = "{}({}) deleted {} messages in channel {}.".format(
|
||||
author.name, author.id, number, channel.name
|
||||
)
|
||||
log.info(reason)
|
||||
|
||||
@@ -211,7 +211,7 @@ class CustomCommands:
|
||||
await ctx.send(_("Custom command successfully added."))
|
||||
except AlreadyExists:
|
||||
await ctx.send(
|
||||
_("This command already exists. Use " "`{}` to edit it.").format(
|
||||
_("This command already exists. Use `{}` to edit it.").format(
|
||||
"{}customcom edit".format(ctx.prefix)
|
||||
)
|
||||
)
|
||||
@@ -232,7 +232,7 @@ class CustomCommands:
|
||||
await ctx.send(_("Custom command successfully edited."))
|
||||
except NotFound:
|
||||
await ctx.send(
|
||||
_("That command doesn't exist. Use " "`{}` to add it.").format(
|
||||
_("That command doesn't exist. Use `{}` to add it.").format(
|
||||
"{}customcom add".format(ctx.prefix)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -41,7 +41,7 @@ class DataConverter:
|
||||
)
|
||||
)
|
||||
while resolver.available:
|
||||
menu = _("Please select a set of data to import by number" ", or 'exit' to exit")
|
||||
menu = _("Please select a set of data to import by number, or 'exit' to exit")
|
||||
for index, entry in enumerate(resolver.available, 1):
|
||||
menu += "\n{}. {}".format(index, entry)
|
||||
|
||||
|
||||
@@ -288,7 +288,7 @@ class Downloader:
|
||||
cog = discord.utils.get(repo_name.available_cogs, name=cog_name) # type: Installable
|
||||
if cog is None:
|
||||
await ctx.send(
|
||||
_("Error, there is no cog by the name of" " `{}` in the `{}` repo.").format(
|
||||
_("Error, there is no cog by the name of `{}` in the `{}` repo.").format(
|
||||
cog_name, repo_name.name
|
||||
)
|
||||
)
|
||||
@@ -305,7 +305,7 @@ class Downloader:
|
||||
|
||||
if not await repo_name.install_requirements(cog, self.LIB_PATH):
|
||||
await ctx.send(
|
||||
_("Failed to install the required libraries for" " `{}`: `{}`").format(
|
||||
_("Failed to install the required libraries for `{}`: `{}`").format(
|
||||
cog.name, cog.requirements
|
||||
)
|
||||
)
|
||||
|
||||
@@ -116,7 +116,7 @@ class Installable(RepoJSONMixin):
|
||||
try:
|
||||
copy_func(src=str(self._location), dst=str(target_dir / self._location.stem))
|
||||
except:
|
||||
log.exception("Error occurred when copying path:" " {}".format(self._location))
|
||||
log.exception("Error occurred when copying path: {}".format(self._location))
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -145,9 +145,7 @@ class Installable(RepoJSONMixin):
|
||||
info = json.load(f)
|
||||
except json.JSONDecodeError:
|
||||
info = {}
|
||||
log.exception(
|
||||
"Invalid JSON information file at path:" " {}".format(info_file_path)
|
||||
)
|
||||
log.exception("Invalid JSON information file at path: {}".format(info_file_path))
|
||||
else:
|
||||
self._info = info
|
||||
|
||||
|
||||
@@ -27,10 +27,8 @@ class Repo(RepoJSONMixin):
|
||||
GIT_LATEST_COMMIT = "git -C {path} rev-parse {branch}"
|
||||
GIT_HARD_RESET = "git -C {path} reset --hard origin/{branch} -q"
|
||||
GIT_PULL = "git -C {path} pull -q --ff-only"
|
||||
GIT_DIFF_FILE_STATUS = (
|
||||
"git -C {path} diff --no-commit-id --name-status" " {old_hash} {new_hash}"
|
||||
)
|
||||
GIT_LOG = "git -C {path} log --relative-date --reverse {old_hash}.." " {relative_file_path}"
|
||||
GIT_DIFF_FILE_STATUS = "git -C {path} diff --no-commit-id --name-status {old_hash} {new_hash}"
|
||||
GIT_LOG = "git -C {path} log --relative-date --reverse {old_hash}.. {relative_file_path}"
|
||||
GIT_DISCOVER_REMOTE_URL = "git -C {path} config --get remote.origin.url"
|
||||
|
||||
PIP_INSTALL = "{python} -m pip install -U -t {target_dir} {reqs}"
|
||||
@@ -98,7 +96,7 @@ class Repo(RepoJSONMixin):
|
||||
)
|
||||
|
||||
if p.returncode != 0:
|
||||
raise GitDiffError("Git diff failed for repo at path:" " {}".format(self.folder_path))
|
||||
raise GitDiffError("Git diff failed for repo at path: {}".format(self.folder_path))
|
||||
|
||||
stdout = p.stdout.strip().decode().split("\n")
|
||||
|
||||
@@ -222,7 +220,7 @@ class Repo(RepoJSONMixin):
|
||||
|
||||
if p.returncode != 0:
|
||||
raise GitException(
|
||||
"Could not determine current branch" " at path: {}".format(self.folder_path)
|
||||
"Could not determine current branch at path: {}".format(self.folder_path)
|
||||
)
|
||||
|
||||
return p.stdout.decode().strip()
|
||||
|
||||
@@ -226,7 +226,7 @@ class Economy:
|
||||
else:
|
||||
await bank.wipe_bank()
|
||||
await ctx.send(
|
||||
_("All bank accounts for {} have been " "deleted.").format(
|
||||
_("All bank accounts for {} have been deleted.").format(
|
||||
self.bot.user.name if await bank.is_global() else "this server"
|
||||
)
|
||||
)
|
||||
@@ -265,7 +265,7 @@ class Economy:
|
||||
else:
|
||||
dtime = self.display_time(next_payday - cur_time)
|
||||
await ctx.send(
|
||||
_("{} Too soon. For your next payday you have to" " wait {}.").format(
|
||||
_("{} Too soon. For your next payday you have to wait {}.").format(
|
||||
author.mention, dtime
|
||||
)
|
||||
)
|
||||
@@ -299,7 +299,7 @@ class Economy:
|
||||
else:
|
||||
dtime = self.display_time(next_payday - cur_time)
|
||||
await ctx.send(
|
||||
_("{} Too soon. For your next payday you have to" " wait {}.").format(
|
||||
_("{} Too soon. For your next payday you have to wait {}.").format(
|
||||
author.mention, dtime
|
||||
)
|
||||
)
|
||||
@@ -425,7 +425,7 @@ class Economy:
|
||||
now = then - bid + pay
|
||||
await bank.set_balance(author, now)
|
||||
await channel.send(
|
||||
_("{}\n{} {}\n\nYour bid: {}\n{} → {}!" "").format(
|
||||
_("{}\n{} {}\n\nYour bid: {}\n{} → {}!").format(
|
||||
slot, author.mention, payout["phrase"], bid, then, now
|
||||
)
|
||||
)
|
||||
@@ -434,7 +434,7 @@ class Economy:
|
||||
await bank.withdraw_credits(author, bid)
|
||||
now = then - bid
|
||||
await channel.send(
|
||||
_("{}\n{} Nothing!\nYour bid: {}\n{} → {}!" "").format(
|
||||
_("{}\n{} Nothing!\nYour bid: {}\n{} → {}!").format(
|
||||
slot, author.mention, bid, then, now
|
||||
)
|
||||
)
|
||||
@@ -495,7 +495,7 @@ class Economy:
|
||||
"""Maximum slot machine bid"""
|
||||
slot_min = await self.config.SLOT_MIN()
|
||||
if bid < 1 or bid < slot_min:
|
||||
await ctx.send(_("Invalid slotmax bid amount. Must be greater" " than slotmin."))
|
||||
await ctx.send(_("Invalid slotmax bid amount. Must be greater than slotmin."))
|
||||
return
|
||||
guild = ctx.guild
|
||||
credits_name = await bank.get_currency_name(guild)
|
||||
@@ -524,9 +524,7 @@ class Economy:
|
||||
else:
|
||||
await self.config.guild(guild).PAYDAY_TIME.set(seconds)
|
||||
await ctx.send(
|
||||
_("Value modified. At least {} seconds must pass " "between each payday.").format(
|
||||
seconds
|
||||
)
|
||||
_("Value modified. At least {} seconds must pass between each payday.").format(seconds)
|
||||
)
|
||||
|
||||
@economyset.command()
|
||||
@@ -541,7 +539,7 @@ class Economy:
|
||||
await self.config.PAYDAY_CREDITS.set(creds)
|
||||
else:
|
||||
await self.config.guild(guild).PAYDAY_CREDITS.set(creds)
|
||||
await ctx.send(_("Every payday will now give {} {}." "").format(creds, credits_name))
|
||||
await ctx.send(_("Every payday will now give {} {}.").format(creds, credits_name))
|
||||
|
||||
@economyset.command()
|
||||
async def rolepaydayamount(self, ctx: commands.Context, role: discord.Role, creds: int):
|
||||
@@ -553,7 +551,7 @@ class Economy:
|
||||
else:
|
||||
await self.config.role(role).PAYDAY_CREDITS.set(creds)
|
||||
await ctx.send(
|
||||
_("Every payday will now give {} {} to people with the role {}." "").format(
|
||||
_("Every payday will now give {} {} to people with the role {}.").format(
|
||||
creds, credits_name, role.name
|
||||
)
|
||||
)
|
||||
@@ -567,7 +565,7 @@ class Economy:
|
||||
credits_name = await bank.get_currency_name(guild)
|
||||
await bank.set_default_balance(creds, guild)
|
||||
await ctx.send(
|
||||
_("Registering an account will now give {} {}." "").format(creds, credits_name)
|
||||
_("Registering an account will now give {} {}.").format(creds, credits_name)
|
||||
)
|
||||
|
||||
# What would I ever do without stackoverflow?
|
||||
|
||||
@@ -132,9 +132,7 @@ class Filter:
|
||||
current_setting = await self.settings.guild(guild).filter_names()
|
||||
await self.settings.guild(guild).filter_names.set(not current_setting)
|
||||
if current_setting:
|
||||
await ctx.send(
|
||||
_("Names and nicknames will no longer be " "checked against the filter.")
|
||||
)
|
||||
await ctx.send(_("Names and nicknames will no longer be checked against the filter."))
|
||||
else:
|
||||
await ctx.send(_("Names and nicknames will now be checked against the filter."))
|
||||
|
||||
|
||||
@@ -97,7 +97,7 @@ class General:
|
||||
msg = ""
|
||||
if user.id == ctx.bot.user.id:
|
||||
user = ctx.author
|
||||
msg = _("Nice try. You think this is funny?\n" "How about *this* instead:\n\n")
|
||||
msg = _("Nice try. You think this is funny?\n How about *this* instead:\n\n")
|
||||
char = "abcdefghijklmnopqrstuvwxyz"
|
||||
tran = "ɐqɔpǝɟƃɥᴉɾʞlɯuodbɹsʇnʌʍxʎz"
|
||||
table = str.maketrans(char, tran)
|
||||
@@ -202,7 +202,7 @@ class General:
|
||||
text_channels = len(guild.text_channels)
|
||||
voice_channels = len(guild.voice_channels)
|
||||
passed = (ctx.message.created_at - guild.created_at).days
|
||||
created_at = _("Since {}. That's over {} days ago!" "").format(
|
||||
created_at = _("Since {}. That's over {} days ago!").format(
|
||||
guild.created_at.strftime("%d %b %Y %H:%M"), passed
|
||||
)
|
||||
|
||||
@@ -227,7 +227,7 @@ class General:
|
||||
try:
|
||||
await ctx.send(embed=data)
|
||||
except discord.HTTPException:
|
||||
await ctx.send(_("I need the `Embed links` permission " "to send this."))
|
||||
await ctx.send(_("I need the `Embed links` permission to send this."))
|
||||
|
||||
@commands.command()
|
||||
async def urban(self, ctx, *, search_terms: str, definition_number: int = 1):
|
||||
@@ -264,7 +264,7 @@ class General:
|
||||
definition = item_list[pos]["definition"]
|
||||
example = item_list[pos]["example"]
|
||||
defs = len(item_list)
|
||||
msg = "**Definition #{} out of {}:\n**{}\n\n" "**Example:\n**{}".format(
|
||||
msg = "**Definition #{} out of {}:\n**{}\n\n**Example:\n**{}".format(
|
||||
pos + 1, defs, definition, example
|
||||
)
|
||||
msg = pagify(msg, ["\n"])
|
||||
|
||||
@@ -145,7 +145,7 @@ class Image:
|
||||
await ctx.send_help()
|
||||
return
|
||||
|
||||
url = "http://api.giphy.com/v1/gifs/search?&api_key={}&q={}" "".format(
|
||||
url = "http://api.giphy.com/v1/gifs/search?&api_key={}&q={}".format(
|
||||
GIPHY_API_KEY, keywords
|
||||
)
|
||||
|
||||
@@ -168,7 +168,7 @@ class Image:
|
||||
await ctx.send_help()
|
||||
return
|
||||
|
||||
url = "http://api.giphy.com/v1/gifs/random?&api_key={}&tag={}" "".format(
|
||||
url = "http://api.giphy.com/v1/gifs/random?&api_key={}&tag={}".format(
|
||||
GIPHY_API_KEY, keywords
|
||||
)
|
||||
|
||||
|
||||
@@ -199,12 +199,12 @@ class Mod:
|
||||
if not toggled:
|
||||
await self.settings.guild(guild).respect_hierarchy.set(True)
|
||||
await ctx.send(
|
||||
_("Role hierarchy will be checked when " "moderation commands are issued.")
|
||||
_("Role hierarchy will be checked when moderation commands are issued.")
|
||||
)
|
||||
else:
|
||||
await self.settings.guild(guild).respect_hierarchy.set(False)
|
||||
await ctx.send(
|
||||
_("Role hierarchy will be ignored when " "moderation commands are issued.")
|
||||
_("Role hierarchy will be ignored when moderation commands are issued.")
|
||||
)
|
||||
|
||||
@modset.command()
|
||||
@@ -241,7 +241,7 @@ class Mod:
|
||||
cur_setting = await self.settings.guild(guild).delete_repeats()
|
||||
if not cur_setting:
|
||||
await self.settings.guild(guild).delete_repeats.set(True)
|
||||
await ctx.send(_("Messages repeated up to 3 times will " "be deleted."))
|
||||
await ctx.send(_("Messages repeated up to 3 times will be deleted."))
|
||||
else:
|
||||
await self.settings.guild(guild).delete_repeats.set(False)
|
||||
await ctx.send(_("Repeated messages will be ignored."))
|
||||
@@ -304,7 +304,7 @@ class Mod:
|
||||
|
||||
if author == user:
|
||||
await ctx.send(
|
||||
_("I cannot let you do that. Self-harm is " "bad {}").format("\N{PENSIVE FACE}")
|
||||
_("I cannot let you do that. Self-harm is bad {}").format("\N{PENSIVE FACE}")
|
||||
)
|
||||
return
|
||||
elif not await is_allowed_by_hierarchy(self.bot, self.settings, guild, author, user):
|
||||
@@ -357,7 +357,7 @@ class Mod:
|
||||
|
||||
if author == user:
|
||||
await ctx.send(
|
||||
_("I cannot let you do that. Self-harm is " "bad {}").format("\N{PENSIVE FACE}")
|
||||
_("I cannot let you do that. Self-harm is bad {}").format("\N{PENSIVE FACE}")
|
||||
)
|
||||
return
|
||||
elif not await is_allowed_by_hierarchy(self.bot, self.settings, guild, author, user):
|
||||
@@ -451,15 +451,15 @@ class Mod:
|
||||
self.ban_queue.append(queue_entry)
|
||||
try:
|
||||
await guild.ban(user, reason=audit_reason)
|
||||
log.info("{}({}) hackbanned {}" "".format(author.name, author.id, user_id))
|
||||
log.info("{}({}) hackbanned {}".format(author.name, author.id, user_id))
|
||||
except discord.NotFound:
|
||||
self.ban_queue.remove(queue_entry)
|
||||
await ctx.send(_("User not found. Have you provided the " "correct user ID?"))
|
||||
await ctx.send(_("User not found. Have you provided the correct user ID?"))
|
||||
except discord.Forbidden:
|
||||
self.ban_queue.remove(queue_entry)
|
||||
await ctx.send(_("I lack the permissions to do this."))
|
||||
else:
|
||||
await ctx.send(_("Done. The user will not be able to join this " "server."))
|
||||
await ctx.send(_("Done. The user will not be able to join this server."))
|
||||
|
||||
user_info = await self.bot.get_user_info(user_id)
|
||||
try:
|
||||
@@ -547,7 +547,7 @@ class Mod:
|
||||
|
||||
if author == user:
|
||||
await ctx.send(
|
||||
_("I cannot let you do that. Self-harm is " "bad {}").format("\N{PENSIVE FACE}")
|
||||
_("I cannot let you do that. Self-harm is bad {}").format("\N{PENSIVE FACE}")
|
||||
)
|
||||
return
|
||||
elif not await is_allowed_by_hierarchy(self.bot, self.settings, guild, author, user):
|
||||
@@ -753,7 +753,7 @@ class Mod:
|
||||
else:
|
||||
await ctx.send(_("That user is already muted and deafened server-wide!"))
|
||||
return
|
||||
await ctx.send(_("User has been banned from speaking or " "listening in voice channels"))
|
||||
await ctx.send(_("User has been banned from speaking or listening in voice channels"))
|
||||
|
||||
try:
|
||||
await modlog.create_case(
|
||||
@@ -825,7 +825,7 @@ class Mod:
|
||||
await ctx.send("Done.")
|
||||
except discord.Forbidden:
|
||||
await ctx.send(
|
||||
_("I cannot do that, I lack the " "'{}' permission.").format("Manage Nicknames")
|
||||
_("I cannot do that, I lack the '{}' permission.").format("Manage Nicknames")
|
||||
)
|
||||
|
||||
@commands.group()
|
||||
@@ -1319,7 +1319,7 @@ class Mod:
|
||||
value="{0.name} (ID {0.id})".format(voice_state.channel),
|
||||
inline=False,
|
||||
)
|
||||
data.set_footer(text=_("Member #{} | User ID: {}" "").format(member_number, user.id))
|
||||
data.set_footer(text=_("Member #{} | User ID: {}").format(member_number, user.id))
|
||||
|
||||
name = str(user)
|
||||
name = " ~ ".join((name, user.nick)) if user.nick else name
|
||||
@@ -1335,7 +1335,7 @@ class Mod:
|
||||
try:
|
||||
await ctx.send(embed=data)
|
||||
except discord.HTTPException:
|
||||
await ctx.send(_("I need the `Embed links` permission " "to send this."))
|
||||
await ctx.send(_("I need the `Embed links` permission to send this."))
|
||||
|
||||
@commands.command()
|
||||
async def names(self, ctx: commands.Context, user: discord.Member):
|
||||
@@ -1355,7 +1355,7 @@ class Mod:
|
||||
if msg:
|
||||
await ctx.send(msg)
|
||||
else:
|
||||
await ctx.send(_("That user doesn't have any recorded name or " "nickname change."))
|
||||
await ctx.send(_("That user doesn't have any recorded name or nickname change."))
|
||||
|
||||
async def get_names_and_nicks(self, user):
|
||||
names = await self.settings.user(user).past_names()
|
||||
@@ -1418,7 +1418,7 @@ class Mod:
|
||||
await guild.ban(author, reason="Mention spam (Autoban)")
|
||||
except discord.HTTPException:
|
||||
log.info(
|
||||
"Failed to ban member for mention spam in " "server {}.".format(guild.id)
|
||||
"Failed to ban member for mention spam in server {}.".format(guild.id)
|
||||
)
|
||||
else:
|
||||
try:
|
||||
|
||||
@@ -35,9 +35,7 @@ class ModLog:
|
||||
await ctx.send(_("Mod events will be sent to {}").format(channel.mention))
|
||||
else:
|
||||
await ctx.send(
|
||||
_("I do not have permissions to " "send messages in {}!").format(
|
||||
channel.mention
|
||||
)
|
||||
_("I do not have permissions to send messages in {}!").format(channel.mention)
|
||||
)
|
||||
else:
|
||||
try:
|
||||
|
||||
@@ -237,7 +237,7 @@ class Reports:
|
||||
|
||||
if author.id in self.user_cache:
|
||||
return await author.send(
|
||||
_("Finish making your prior report " "before making an additional one")
|
||||
_("Please finish making your prior report before making an additional one")
|
||||
)
|
||||
|
||||
if ctx.guild:
|
||||
|
||||
@@ -199,7 +199,7 @@ class Streams:
|
||||
self.streams = streams
|
||||
await self.save_streams()
|
||||
|
||||
msg = _("All {}'s stream alerts have been disabled." "").format(
|
||||
msg = _("All {}'s stream alerts have been disabled.").format(
|
||||
"server" if _all else "channel"
|
||||
)
|
||||
|
||||
@@ -240,16 +240,16 @@ class Streams:
|
||||
exists = await self.check_exists(stream)
|
||||
except InvalidTwitchCredentials:
|
||||
await ctx.send(
|
||||
_("The twitch token is either invalid or has not been set. " "See {}.").format(
|
||||
_("The twitch token is either invalid or has not been set. See {}.").format(
|
||||
"`{}streamset twitchtoken`".format(ctx.prefix)
|
||||
)
|
||||
)
|
||||
return
|
||||
except InvalidYoutubeCredentials:
|
||||
await ctx.send(
|
||||
_(
|
||||
"The Youtube API key is either invalid or has not been set. " "See {}."
|
||||
).format("`{}streamset youtubekey`".format(ctx.prefix))
|
||||
_("The Youtube API key is either invalid or has not been set. See {}.").format(
|
||||
"`{}streamset youtubekey`".format(ctx.prefix)
|
||||
)
|
||||
)
|
||||
return
|
||||
except APIError:
|
||||
|
||||
@@ -262,7 +262,7 @@ class TwitchStream(Stream):
|
||||
url = channel["url"]
|
||||
logo = channel["logo"]
|
||||
if logo is None:
|
||||
logo = "https://static-cdn.jtvnw.net/" "jtv_user_pictures/xarth/404_user_70x70.png"
|
||||
logo = "https://static-cdn.jtvnw.net/jtv_user_pictures/xarth/404_user_70x70.png"
|
||||
status = channel["status"]
|
||||
if not status:
|
||||
status = "Untitled broadcast"
|
||||
@@ -342,7 +342,7 @@ class MixerStream(Stream):
|
||||
raise APIError()
|
||||
|
||||
def make_embed(self, data):
|
||||
default_avatar = "https://mixer.com/_latest/assets/images/main/" "avatars/default.jpg"
|
||||
default_avatar = "https://mixer.com/_latest/assets/images/main/avatars/default.jpg"
|
||||
user = data["user"]
|
||||
url = "https://mixer.com/" + data["token"]
|
||||
embed = discord.Embed(title=data["name"], url=url)
|
||||
@@ -383,7 +383,7 @@ class PicartoStream(Stream):
|
||||
|
||||
def make_embed(self, data):
|
||||
avatar = rnd(
|
||||
"https://picarto.tv/user_data/usrimg/{}/dsdefault.jpg" "".format(data["name"].lower())
|
||||
"https://picarto.tv/user_data/usrimg/{}/dsdefault.jpg".format(data["name"].lower())
|
||||
)
|
||||
url = "https://picarto.tv/" + data["name"]
|
||||
thumbnail = data["thumbnails"]["web"]
|
||||
@@ -405,5 +405,5 @@ class PicartoStream(Stream):
|
||||
data["adult"] = ""
|
||||
|
||||
embed.color = 0x4C90F3
|
||||
embed.set_footer(text="{adult}Category: {category} | Tags: {tags}" "".format(**data))
|
||||
embed.set_footer(text="{adult}Category: {category} | Tags: {tags}".format(**data))
|
||||
return embed
|
||||
|
||||
@@ -82,7 +82,7 @@ class Trivia:
|
||||
return
|
||||
settings = self.conf.guild(ctx.guild)
|
||||
await settings.delay.set(seconds)
|
||||
await ctx.send("Done. Maximum seconds to answer set to {}." "".format(seconds))
|
||||
await ctx.send("Done. Maximum seconds to answer set to {}.".format(seconds))
|
||||
|
||||
@triviaset.command(name="stopafter")
|
||||
async def triviaset_stopafter(self, ctx: commands.Context, seconds: float):
|
||||
@@ -246,7 +246,7 @@ class Trivia:
|
||||
"""List available trivia categories."""
|
||||
lists = set(p.stem for p in self._all_lists())
|
||||
|
||||
msg = box("**Available trivia lists**\n\n{}" "".format(", ".join(sorted(lists))))
|
||||
msg = box("**Available trivia lists**\n\n{}".format(", ".join(sorted(lists))))
|
||||
if len(msg) > 1000:
|
||||
await ctx.author.send(msg)
|
||||
return
|
||||
|
||||
@@ -70,7 +70,7 @@ def get_command_from_input(bot, userinput: str):
|
||||
if any(inspect.getsource(x) in check_str for x in com.checks):
|
||||
# command the user specified has the is_owner check
|
||||
return None, _(
|
||||
"That command requires bot owner. I can't " "allow you to use that for an action"
|
||||
"That command requires bot owner. I can't allow you to use that for an action"
|
||||
)
|
||||
return "{prefix}" + orig, None
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class Warnings:
|
||||
@warningset.command()
|
||||
@commands.guild_only()
|
||||
async def allowcustomreasons(self, ctx: commands.Context, allowed: bool):
|
||||
"""Allow or disallow custom reasons for a warning"""
|
||||
"""Enable or Disable custom reasons for a warning"""
|
||||
guild = ctx.guild
|
||||
await self.config.guild(guild).allow_custom_reasons.set(allowed)
|
||||
await ctx.send(
|
||||
|
||||
Reference in New Issue
Block a user