From 31043ac8f05b810dfb8fd35113e7bdd0d45be28c Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Wed, 12 Aug 2020 17:02:12 +0400 Subject: [PATCH 01/17] [translators] rework `[p]emojify` --- translators/locales/messages.pot | 60 ++++++++++++++++---------------- translators/translators.py | 27 ++++++++------ 2 files changed, 46 insertions(+), 41 deletions(-) diff --git a/translators/locales/messages.pot b/translators/locales/messages.pot index 5571eb23..fd22d8fe 100644 --- a/translators/locales/messages.pot +++ b/translators/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,17 +11,17 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: translators\translators.py:33 +#: translators\translators.py:32 #, docstring msgid "Useful (and not) translators" msgstr "" -#: translators\translators.py:48 +#: translators\translators.py:50 #, docstring msgid "Set API key for Yandex.Translate" msgstr "" -#: translators\translators.py:49 +#: translators\translators.py:51 msgid "" "To get Yandex.Translate API key:\n" "1. Login to your Yandex account\n" @@ -32,7 +32,7 @@ msgid "" "5. Use `{}set api yandex translate `" msgstr "" -#: translators\translators.py:63 +#: translators\translators.py:65 #, docstring msgid "" "Translate text via Yandex\n" @@ -41,47 +41,47 @@ msgid "" " or \"en-ru\" (original text's language - target language)" msgstr "" -#: translators\translators.py:76 +#: translators\translators.py:78 msgid "" "This command requires valid API key, check {}ytapikey to get more " "information" msgstr "" -#: translators\translators.py:84 +#: translators\translators.py:86 msgid "" "An error has been occurred: Language {} is not supported or incorrect, check" " your formatting and try again" msgstr "" -#: translators\translators.py:94 +#: translators\translators.py:96 msgid "" "An error has been occurred: Text that you provided is too big to translate" msgstr "" -#: translators\translators.py:100 +#: translators\translators.py:102 msgid "" "API key is blocked. Bot owner needs to get new api key or unlock current." msgstr "" -#: translators\translators.py:104 +#: translators\translators.py:106 msgid "Daily requests limit reached. Try again later." msgstr "" -#: translators\translators.py:108 +#: translators\translators.py:110 msgid "" "An error has been occurred: Yandex.Translate is unable to translate your " "text" msgstr "" -#: translators\translators.py:114 +#: translators\translators.py:116 msgid "An error has been occurred: {}" msgstr "" -#: translators\translators.py:121 +#: translators\translators.py:123 msgid "Translated via Yandex.Translate" msgstr "" -#: translators\translators.py:129 +#: translators\translators.py:131 #, docstring msgid "" "Say something via Google Translate\n" @@ -91,15 +91,15 @@ msgid "" " If text contains more than 200 symbols, it will be cut" msgstr "" -#: translators\translators.py:147 +#: translators\translators.py:149 msgid "Language {} is not supported or incorrect" msgstr "" -#: translators\translators.py:151 +#: translators\translators.py:153 msgid "Unable to get data from Google Translate TTS: {}" msgstr "" -#: translators\translators.py:161 +#: translators\translators.py:163 #, docstring msgid "" "Translates text (cyrillic/latin) to \"eciho\"\n" @@ -109,7 +109,7 @@ msgid "" " This is unusable shit, i know, but whatever" msgstr "" -#: translators\translators.py:187 +#: translators\translators.py:189 #, docstring msgid "" "Flips text upside-down\n" @@ -117,63 +117,63 @@ msgid "" " Based on https://unicode-table.com/en/tools/flip/" msgstr "" -#: translators\translators.py:204 +#: translators\translators.py:206 #, docstring msgid "Switches text to Full-width characters" msgstr "" -#: translators\translators.py:217 +#: translators\translators.py:219 #, docstring msgid "Leet (1337) translation commands" msgstr "" -#: translators\translators.py:222 +#: translators\translators.py:224 #, docstring msgid "Translates provided text to 1337" msgstr "" -#: translators\translators.py:258 +#: translators\translators.py:260 #, docstring msgid "Translate cyrillic to 1337" msgstr "" -#: translators\translators.py:302 +#: translators\translators.py:304 #, docstring msgid "Base64 text converter" msgstr "" -#: translators\translators.py:307 +#: translators\translators.py:309 #, docstring msgid "Encode text to Base64" msgstr "" -#: translators\translators.py:318 +#: translators\translators.py:320 #, docstring msgid "Decode text from Base64" msgstr "" -#: translators\translators.py:326 +#: translators\translators.py:328 msgid "Invalid Base64 string provided" msgstr "" -#: translators\translators.py:334 +#: translators\translators.py:336 #, docstring msgid "Emojify text" msgstr "" -#: translators\translators.py:361 +#: translators\translators.py:363 #, docstring msgid "Encode or decode text in URL-format (\"%20\"-format)" msgstr "" -#: translators\translators.py:366 +#: translators\translators.py:368 #, docstring msgid "" "Encode text to url-like format\n" " 'abc def' -> 'abc%20def'" msgstr "" -#: translators\translators.py:377 +#: translators\translators.py:379 #, docstring msgid "" "Decode text from url-like format\n" diff --git a/translators/translators.py b/translators/translators.py index 00ca3bdd..e4ac745c 100644 --- a/translators/translators.py +++ b/translators/translators.py @@ -4,6 +4,7 @@ import re from binascii import Error as binasciiError from io import BytesIO +from string import ascii_letters from typing import Optional from urllib import parse @@ -31,7 +32,7 @@ class Translators(commands.Cog): """Useful (and not) translators""" - __version__ = "2.1.3" + __version__ = "2.1.4" # noinspection PyMissingConstructor def __init__(self, bot): @@ -330,20 +331,18 @@ async def frombase64(self, ctx, encoding: Optional[PySupportedEncoding], *, enco result = decoded.decode(encoding=encoding, errors="replace") await ctx.send(chat.box(result)) - # noinspection PyPep8 @commands.command() async def emojify(self, ctx, *, message: str): """Emojify text""" - char = "abcdefghijklmnopqrstuvwxyz↓↑←→—.!" - tran = "🇦🇧🇨🇩🇪🇫🇬🇭🇮🇯🇰🇱🇲🇳🇴🇵🇶🇷🇸🇹🇺🇻🇼🇽🇾🇿⬇⬆⬅➡➖⏺ℹ" + char = "↓↑←→—.!" + tran = "⬇⬆⬅➡➖⏺ℹ" table = str.maketrans(char, tran) - name = message.translate(table) - char = char.upper() - table = str.maketrans(char, tran) - name = name.translate(table) - await ctx.send( - name.replace(" ", "  ") - .replace("", "​") + message = message.translate(table) + message = "".join( + map(lambda c: f"regional_indicator_{c}" if c in ascii_letters else c, message) + ) + message = ( + message.replace(" ", "  ") .replace("0", ":zero:") .replace("1", ":one:") .replace("2", ":two:") @@ -357,6 +356,12 @@ async def emojify(self, ctx, *, message: str): .replace("#", "#⃣") .replace("*", "*⃣") ) + await self.bot.http.request( # TODO: Switch this to allowed_mentions in next release of Red with dpy 1.4 + discord.http.Route( + "POST", "/channels/{channel_id}/messages", channel_id=ctx.channel.id + ), + json={"content": message[:2000], "allowed_mentions": {"parse": [], "roles": [], "users": []}}, + ) @commands.group() async def url(self, ctx): From 26854bceb1265bda2506d8f1188dbab3635a6244 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Wed, 12 Aug 2020 17:04:19 +0400 Subject: [PATCH 02/17] [translators] fix previous commit *i cant be that dumb, can i?* --- translators/translators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translators/translators.py b/translators/translators.py index e4ac745c..779e7092 100644 --- a/translators/translators.py +++ b/translators/translators.py @@ -32,7 +32,7 @@ class Translators(commands.Cog): """Useful (and not) translators""" - __version__ = "2.1.4" + __version__ = "2.1.5" # noinspection PyMissingConstructor def __init__(self, bot): @@ -339,7 +339,7 @@ async def emojify(self, ctx, *, message: str): table = str.maketrans(char, tran) message = message.translate(table) message = "".join( - map(lambda c: f"regional_indicator_{c}" if c in ascii_letters else c, message) + map(lambda c: f":regional_indicator_{c}:" if c in ascii_letters else c, message) ) message = ( message.replace(" ", "  ") From 26b4f71dcb667058c861208913ce00d6e2c46c49 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Wed, 12 Aug 2020 17:20:35 +0400 Subject: [PATCH 03/17] [translators] rework `[p]emojify` more --- translators/translators.py | 47 +++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/translators/translators.py b/translators/translators.py index 779e7092..e1da2659 100644 --- a/translators/translators.py +++ b/translators/translators.py @@ -2,9 +2,9 @@ import itertools import random import re +import string from binascii import Error as binasciiError from io import BytesIO -from string import ascii_letters from typing import Optional from urllib import parse @@ -27,12 +27,24 @@ "Safari/537.36" ) +# noinspection PyDictDuplicateKeys +EMOJIFY_CHARS = { + "\N{DOWNWARDS ARROW}": "\N{DOWNWARDS BLACK ARROW}", + "\N{UPWARDS ARROW}": "\N{UPWARDS BLACK ARROW}", + "\N{LEFTWARDS ARROW}": "\N{LEFTWARDS BLACK ARROW}", + "\N{RIGHTWARDS ARROW}": "\N{BLACK RIGHTWARDS ARROW}", + "\N{EM DASH}": "\N{HEAVY MINUS SIGN}", + "\N{HYPHEN-MINUS}": "\N{HEAVY MINUS SIGN}", + "\N{FULL STOP}": "\N{BLACK CIRCLE FOR RECORD}", + "\N{EXCLAMATION MARK}": "\N{INFORMATION SOURCE}", +} + @cog_i18n(_) class Translators(commands.Cog): """Useful (and not) translators""" - __version__ = "2.1.5" + __version__ = "2.1.6" # noinspection PyMissingConstructor def __init__(self, bot): @@ -334,33 +346,30 @@ async def frombase64(self, ctx, encoding: Optional[PySupportedEncoding], *, enco @commands.command() async def emojify(self, ctx, *, message: str): """Emojify text""" - char = "↓↑←→—.!" - tran = "⬇⬆⬅➡➖⏺ℹ" - table = str.maketrans(char, tran) + table = str.maketrans("".join(EMOJIFY_CHARS.keys()), "".join(EMOJIFY_CHARS.values())) message = message.translate(table) message = "".join( - map(lambda c: f":regional_indicator_{c}:" if c in ascii_letters else c, message) + map(lambda c: f":regional_indicator_{c}:" if c in string.ascii_letters else c, message) + ) + message = "".join( + map( + lambda c: f"{c}\N{COMBINING ENCLOSING KEYCAP}" if c in string.digits else c, + message, + ) ) message = ( message.replace(" ", "  ") - .replace("0", ":zero:") - .replace("1", ":one:") - .replace("2", ":two:") - .replace("3", ":three:") - .replace("4", ":four:") - .replace("5", ":five:") - .replace("6", ":six:") - .replace("7", ":seven:") - .replace("8", ":eight:") - .replace("9", ":nine:") - .replace("#", "#⃣") - .replace("*", "*⃣") + .replace("#", "#\N{COMBINING ENCLOSING KEYCAP}") + .replace("*", "*\N{COMBINING ENCLOSING KEYCAP}") ) await self.bot.http.request( # TODO: Switch this to allowed_mentions in next release of Red with dpy 1.4 discord.http.Route( "POST", "/channels/{channel_id}/messages", channel_id=ctx.channel.id ), - json={"content": message[:2000], "allowed_mentions": {"parse": [], "roles": [], "users": []}}, + json={ + "content": message[:2000], + "allowed_mentions": {"parse": [], "roles": [], "users": []}, + }, ) @commands.group() From 89203adcfb88f85c0346fbb622cb61b44c5a28e6 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Wed, 12 Aug 2020 17:23:04 +0400 Subject: [PATCH 04/17] [translators] note to self: stop testing in production --- translators/translators.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/translators/translators.py b/translators/translators.py index e1da2659..ebefa7c4 100644 --- a/translators/translators.py +++ b/translators/translators.py @@ -44,7 +44,7 @@ class Translators(commands.Cog): """Useful (and not) translators""" - __version__ = "2.1.6" + __version__ = "2.1.7" # noinspection PyMissingConstructor def __init__(self, bot): @@ -349,7 +349,10 @@ async def emojify(self, ctx, *, message: str): table = str.maketrans("".join(EMOJIFY_CHARS.keys()), "".join(EMOJIFY_CHARS.values())) message = message.translate(table) message = "".join( - map(lambda c: f":regional_indicator_{c}:" if c in string.ascii_letters else c, message) + map( + lambda c: f":regional_indicator_{c.lower()}:" if c in string.ascii_letters else c, + message, + ) ) message = "".join( map( From bdeaa1e66c14bd1ba6b3c378d637044a9b718189 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Sun, 16 Aug 2020 12:34:48 +0400 Subject: [PATCH 05/17] [personalroles] add discord.User to Union arg of unassign cmd less fetch_user requests --- personalroles/locales/messages.pot | 60 +++++++++++++++--------------- personalroles/personalroles.py | 4 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/personalroles/locales/messages.pot b/personalroles/locales/messages.pot index e36b7667..10555358 100644 --- a/personalroles/locales/messages.pot +++ b/personalroles/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -16,132 +16,132 @@ msgstr "" msgid "Assign and edit personal roles" msgstr "" -#: personalroles\personalroles.py:39 +#: personalroles\personalroles.py:46 #, docstring msgid "Control of personal role" msgstr "" -#: personalroles\personalroles.py:45 +#: personalroles\personalroles.py:52 #, docstring msgid "Assign personal role to someone" msgstr "" -#: personalroles\personalroles.py:48 +#: personalroles\personalroles.py:55 msgid "" "Ok. I just assigned {user.name} ({user.id}) to role {role.name} ({role.id})." msgstr "" -#: personalroles\personalroles.py:56 +#: personalroles\personalroles.py:63 #, docstring msgid "Unassign personal role from someone" msgstr "" -#: personalroles\personalroles.py:65 +#: personalroles\personalroles.py:72 msgid "[Unknown or Deleted User]" msgstr "" -#: personalroles\personalroles.py:67 +#: personalroles\personalroles.py:74 msgid "Ok. I just unassigned {user.name} ({user.id}) from his personal role." msgstr "" -#: personalroles\personalroles.py:75 +#: personalroles\personalroles.py:82 #, docstring msgid "Assigned roles list" msgstr "" -#: personalroles\personalroles.py:82 +#: personalroles\personalroles.py:89 msgid "User" msgstr "" -#: personalroles\personalroles.py:83 +#: personalroles\personalroles.py:90 msgid "Role" msgstr "" -#: personalroles\personalroles.py:95 +#: personalroles\personalroles.py:102 msgid "There is no assigned personal roles on this server" msgstr "" -#: personalroles\personalroles.py:101 +#: personalroles\personalroles.py:108 #, docstring msgid "Manage blacklisted names" msgstr "" -#: personalroles\personalroles.py:107 +#: personalroles\personalroles.py:114 #, docstring msgid "" "Add rolename to blacklist\n" " Members will be not able to change name of role to blacklisted names" msgstr "" -#: personalroles\personalroles.py:112 +#: personalroles\personalroles.py:119 msgid "`{}` is already in blacklist" msgstr "" -#: personalroles\personalroles.py:116 +#: personalroles\personalroles.py:123 msgid "Added `{}` to blacklisted roles list" msgstr "" -#: personalroles\personalroles.py:122 +#: personalroles\personalroles.py:129 #, docstring msgid "Remove rolename from blacklist" msgstr "" -#: personalroles\personalroles.py:126 +#: personalroles\personalroles.py:133 msgid "`{}` is not blacklisted" msgstr "" -#: personalroles\personalroles.py:130 +#: personalroles\personalroles.py:137 msgid "Removed `{}` from blacklisted roles list" msgstr "" -#: personalroles\personalroles.py:136 +#: personalroles\personalroles.py:143 #, docstring msgid "List of blacklisted role names" msgstr "" -#: personalroles\personalroles.py:142 +#: personalroles\personalroles.py:149 msgid "There is no blacklisted roles" msgstr "" -#: personalroles\personalroles.py:149 +#: personalroles\personalroles.py:156 #, docstring msgid "Change color of personal role" msgstr "" -#: personalroles\personalroles.py:153 personalroles\personalroles.py:193 -#: personalroles\personalroles.py:222 +#: personalroles\personalroles.py:160 personalroles\personalroles.py:200 +#: personalroles\personalroles.py:229 msgid "Personal Role" msgstr "" -#: personalroles\personalroles.py:158 personalroles\personalroles.py:198 +#: personalroles\personalroles.py:165 personalroles\personalroles.py:205 msgid "" "Unable to edit role.\n" "Role must be lower than my top role and i must have permission \"Manage Roles\"" msgstr "" -#: personalroles\personalroles.py:166 personalroles\personalroles.py:206 +#: personalroles\personalroles.py:173 personalroles\personalroles.py:213 msgid "Unable to edit role: {}" msgstr "" -#: personalroles\personalroles.py:170 +#: personalroles\personalroles.py:177 msgid "Reset {user}'s personal role color" msgstr "" -#: personalroles\personalroles.py:174 +#: personalroles\personalroles.py:181 msgid "Changed color of {user}'s personal role to {color}" msgstr "" -#: personalroles\personalroles.py:184 +#: personalroles\personalroles.py:191 #, docstring msgid "" "Change name of personal role\n" " You cant use blacklisted names" msgstr "" -#: personalroles\personalroles.py:190 +#: personalroles\personalroles.py:197 msgid "NONONO!!! This rolename is blacklisted." msgstr "" -#: personalroles\personalroles.py:209 +#: personalroles\personalroles.py:216 msgid "Changed name of {user}'s personal role to {name}" msgstr "" diff --git a/personalroles/personalroles.py b/personalroles/personalroles.py index 4ad4a2fb..f3890b51 100644 --- a/personalroles/personalroles.py +++ b/personalroles/personalroles.py @@ -22,7 +22,7 @@ async def has_assigned_role(ctx): class PersonalRoles(commands.Cog): """Assign and edit personal roles""" - __version__ = "2.0.5" + __version__ = "2.0.6" # noinspection PyMissingConstructor def __init__(self, bot): @@ -59,7 +59,7 @@ async def assign(self, ctx, user: discord.Member, *, role: discord.Role): @myrole.command() @checks.admin_or_permissions(manage_roles=True) - async def unassign(self, ctx, *, user: Union[discord.Member, int]): + async def unassign(self, ctx, *, user: Union[discord.Member, discord.User, int]): """Unassign personal role from someone""" if isinstance(user, discord.Member): await self.config.member(user).role.clear() From b0559ee1c4dc1085d798765af572bbf42703fabf Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 10:32:08 +0400 Subject: [PATCH 06/17] [messageslog] support for cog disabling (red 3.4) --- messageslog/info.json | 2 +- messageslog/locales/messages.pot | 94 +++++++++++++++++--------------- messageslog/messageslog.py | 24 +++++--- 3 files changed, 68 insertions(+), 52 deletions(-) diff --git a/messageslog/info.json b/messageslog/info.json index b1f3836a..31ed2dff 100644 --- a/messageslog/info.json +++ b/messageslog/info.json @@ -5,7 +5,7 @@ "install_msg": "Thanks for install.", "short": "Log deleted and redacted messages in defined channel", "description": "Log deleted and redacted messages in defined channel", - "min_bot_version": "3.2.1", + "min_bot_version": "3.4.0", "tags": [ "messages", "logs" diff --git a/messageslog/locales/messages.pot b/messageslog/locales/messages.pot index 3617dc4c..c9b84c10 100644 --- a/messageslog/locales/messages.pot +++ b/messageslog/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,22 +11,22 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: messageslog\messageslog.py:42 +#: messageslog\messageslog.py:41 #, docstring msgid "Log deleted and redacted messages to the defined channel" msgstr "" -#: messageslog\messageslog.py:84 +#: messageslog\messageslog.py:86 #, docstring msgid "Manage message logging" msgstr "" -#: messageslog\messageslog.py:89 +#: messageslog\messageslog.py:91 #, docstring msgid "Set the channels for logs" msgstr "" -#: messageslog\messageslog.py:94 +#: messageslog\messageslog.py:96 #, docstring msgid "" "Set the channel for deleted messages logs\n" @@ -34,7 +34,7 @@ msgid "" " If channel is not specified, then logging will be disabled" msgstr "" -#: messageslog\messageslog.py:102 +#: messageslog\messageslog.py:104 #, docstring msgid "" "Set the channel for edited messages logs\n" @@ -42,7 +42,7 @@ msgid "" " If channel is not specified, then logging will be disabled" msgstr "" -#: messageslog\messageslog.py:110 +#: messageslog\messageslog.py:112 #, docstring msgid "" "Set the channel for bulk deletion logs\n" @@ -50,70 +50,78 @@ msgid "" " If channel is not specified, then logging will be disabled" msgstr "" -#: messageslog\messageslog.py:118 +#: messageslog\messageslog.py:120 +#, docstring +msgid "" +"Set the channel for all logs\n" +" \n" +" If channel is not specified, then logging will be disabled" +msgstr "" + +#: messageslog\messageslog.py:130 #, docstring msgid "View current channels settings" msgstr "" -#: messageslog\messageslog.py:121 +#: messageslog\messageslog.py:133 msgid "Deletion: {}" msgstr "" -#: messageslog\messageslog.py:123 +#: messageslog\messageslog.py:135 msgid "Edit: {}" msgstr "" -#: messageslog\messageslog.py:125 +#: messageslog\messageslog.py:137 msgid "Bulk deletion: {}" msgstr "" -#: messageslog\messageslog.py:126 +#: messageslog\messageslog.py:138 msgid "No channels set" msgstr "" -#: messageslog\messageslog.py:130 +#: messageslog\messageslog.py:142 #, docstring msgid "Toggle logging" msgstr "" -#: messageslog\messageslog.py:136 +#: messageslog\messageslog.py:148 #, docstring msgid "Toggle logging of message deletion" msgstr "" -#: messageslog\messageslog.py:139 messageslog\messageslog.py:148 -#: messageslog\messageslog.py:157 +#: messageslog\messageslog.py:151 messageslog\messageslog.py:160 +#: messageslog\messageslog.py:169 msgid "enabled" msgstr "" -#: messageslog\messageslog.py:139 messageslog\messageslog.py:148 -#: messageslog\messageslog.py:157 +#: messageslog\messageslog.py:151 messageslog\messageslog.py:160 +#: messageslog\messageslog.py:169 msgid "disabled" msgstr "" -#: messageslog\messageslog.py:140 +#: messageslog\messageslog.py:152 msgid "Message deletion logging {}" msgstr "" -#: messageslog\messageslog.py:145 +#: messageslog\messageslog.py:157 #, docstring msgid "Toggle logging of message editing" msgstr "" -#: messageslog\messageslog.py:149 +#: messageslog\messageslog.py:161 msgid "Message editing logging {}" msgstr "" -#: messageslog\messageslog.py:154 +#: messageslog\messageslog.py:166 #, docstring msgid "Toggle saving of bulk message deletion" msgstr "" -#: messageslog\messageslog.py:158 +#: messageslog\messageslog.py:170 msgid "Bulk message removal saving {}" msgstr "" -#: messageslog\messageslog.py:164 +#: messageslog\messageslog.py:176 #, docstring msgid "" "Manage message logging blacklist\n" @@ -123,72 +131,72 @@ msgid "" " If item is in blacklist, removes it" msgstr "" -#: messageslog\messageslog.py:181 +#: messageslog\messageslog.py:193 msgid "Nothing is ignored" msgstr "" -#: messageslog\messageslog.py:187 +#: messageslog\messageslog.py:199 msgid "Ignored users" msgstr "" -#: messageslog\messageslog.py:189 +#: messageslog\messageslog.py:201 msgid "Ignored channels" msgstr "" -#: messageslog\messageslog.py:192 +#: messageslog\messageslog.py:204 msgid "Ignored categories" msgstr "" -#: messageslog\messageslog.py:237 +#: messageslog\messageslog.py:249 msgid "Message deleted" msgstr "" -#: messageslog\messageslog.py:238 messageslog\messageslog.py:383 +#: messageslog\messageslog.py:250 messageslog\messageslog.py:395 msgid "No text" msgstr "" -#: messageslog\messageslog.py:244 messageslog\messageslog.py:390 +#: messageslog\messageslog.py:256 messageslog\messageslog.py:402 msgid "Attachments" msgstr "" -#: messageslog\messageslog.py:247 messageslog\messageslog.py:393 +#: messageslog\messageslog.py:259 messageslog\messageslog.py:405 msgid "[{0.filename}]({0.url}) ([Cached]({0.proxy_url}))" msgstr "" -#: messageslog\messageslog.py:253 messageslog\messageslog.py:289 -#: messageslog\messageslog.py:399 +#: messageslog\messageslog.py:265 messageslog\messageslog.py:301 +#: messageslog\messageslog.py:411 msgid "ID: {} • Sent at" msgstr "" -#: messageslog\messageslog.py:254 messageslog\messageslog.py:290 -#: messageslog\messageslog.py:350 +#: messageslog\messageslog.py:266 messageslog\messageslog.py:302 +#: messageslog\messageslog.py:362 msgid "Channel" msgstr "" -#: messageslog\messageslog.py:285 +#: messageslog\messageslog.py:297 msgid "Old message deleted" msgstr "" -#: messageslog\messageslog.py:340 +#: messageslog\messageslog.py:352 msgid "Multiple messages deleted" msgstr "" -#: messageslog\messageslog.py:341 +#: messageslog\messageslog.py:353 msgid "{} messages removed" msgstr "" -#: messageslog\messageslog.py:343 +#: messageslog\messageslog.py:355 msgid "{} messages saved to file above" msgstr "" -#: messageslog\messageslog.py:382 +#: messageslog\messageslog.py:394 msgid "Message redacted" msgstr "" -#: messageslog\messageslog.py:387 +#: messageslog\messageslog.py:399 msgid "Now" msgstr "" -#: messageslog\messageslog.py:387 +#: messageslog\messageslog.py:399 msgid "[View message]({})" msgstr "" diff --git a/messageslog/messageslog.py b/messageslog/messageslog.py index a50bafb3..5ce6bb18 100644 --- a/messageslog/messageslog.py +++ b/messageslog/messageslog.py @@ -40,7 +40,7 @@ async def ignore_config_add(config: list, item): class MessagesLog(commands.Cog): """Log deleted and redacted messages to the defined channel""" - __version__ = "2.3.6" + __version__ = "2.3.7" # noinspection PyMissingConstructor def __init__(self, bot): @@ -86,12 +86,12 @@ async def messageslog(self, ctx): """Manage message logging""" pass - @messageslog.group() - async def channel(self, ctx): + @messageslog.group(name="channel") + async def set_channel(self, ctx): """Set the channels for logs""" pass - @channel.command(name="delete") + @set_channel.command(name="delete") async def delete_channel(self, ctx, *, channel: discord.TextChannel = None): """Set the channel for deleted messages logs @@ -99,7 +99,7 @@ async def delete_channel(self, ctx, *, channel: discord.TextChannel = None): await self.config.guild(ctx.guild).delete_channel.set(channel.id if channel else None) await ctx.tick() - @channel.command(name="edit") + @set_channel.command(name="edit") async def edit_channel(self, ctx, *, channel: discord.TextChannel = None): """Set the channel for edited messages logs @@ -107,7 +107,7 @@ async def edit_channel(self, ctx, *, channel: discord.TextChannel = None): await self.config.guild(ctx.guild).edit_channel.set(channel.id if channel else None) await ctx.tick() - @channel.command(name="bulk") + @set_channel.command(name="bulk") async def bulk_channel(self, ctx, *, channel: discord.TextChannel = None): """Set the channel for bulk deletion logs @@ -115,7 +115,7 @@ async def bulk_channel(self, ctx, *, channel: discord.TextChannel = None): await self.config.guild(ctx.guild).bulk_delete_channel.set(channel.id if channel else None) await ctx.tick() - @channel.command(name="all") + @set_channel.command(name="all") async def all_channel(self, ctx, *, channel: discord.TextChannel = None): """Set the channel for all logs @@ -125,7 +125,7 @@ async def all_channel(self, ctx, *, channel: discord.TextChannel = None): await self.config.guild(ctx.guild).bulk_delete_channel.set(channel.id if channel else None) await ctx.tick() - @channel.command(name="settings") + @set_channel.command(name="settings") async def channel_settings(self, ctx): """View current channels settings""" settings = [] @@ -223,6 +223,8 @@ async def ignore( async def message_deleted(self, message: discord.Message): if not message.guild: return + if await self.bot.cog_disabled_in_guild(self, message.guild): + return logchannel = message.guild.get_channel( await self.config.guild(message.guild).delete_channel() ) @@ -275,6 +277,8 @@ async def raw_message_deleted(self, payload: discord.RawMessageDeleteEvent): return if not payload.guild_id: return + if await self.bot.cog_disabled_in_guild_raw(self.qualified_name, payload.guild_id): + return guild = self.bot.get_guild(payload.guild_id) channel = self.bot.get_channel(payload.channel_id) logchannel = guild.get_channel(await self.config.guild(guild).delete_channel()) @@ -309,6 +313,8 @@ async def raw_message_deleted(self, payload: discord.RawMessageDeleteEvent): async def raw_bulk_message_deleted(self, payload: discord.RawBulkMessageDeleteEvent): if not payload.guild_id: return + if await self.bot.cog_disabled_in_guild_raw(self.qualified_name, payload.guild_id): + return guild = self.bot.get_guild(payload.guild_id) channel = self.bot.get_channel(payload.channel_id) logchannel = guild.get_channel(await self.config.guild(guild).bulk_delete_channel()) @@ -369,6 +375,8 @@ async def raw_bulk_message_deleted(self, payload: discord.RawBulkMessageDeleteEv async def message_redacted(self, before: discord.Message, after: discord.Message): if not before.guild: return + if await self.bot.cog_disabled_in_guild(self, before.guild): + return logchannel = before.guild.get_channel(await self.config.guild(before.guild).edit_channel()) if not logchannel: return From 37649bf479bb42216a7cc8c3461325241bf91f98 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 10:35:59 +0400 Subject: [PATCH 07/17] [personalroles] support for cog disabling (red 3.4) --- personalroles/personalroles.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/personalroles/personalroles.py b/personalroles/personalroles.py index f3890b51..5bb3dd57 100644 --- a/personalroles/personalroles.py +++ b/personalroles/personalroles.py @@ -22,7 +22,7 @@ async def has_assigned_role(ctx): class PersonalRoles(commands.Cog): """Assign and edit personal roles""" - __version__ = "2.0.6" + __version__ = "2.0.7" # noinspection PyMissingConstructor def __init__(self, bot): @@ -221,6 +221,8 @@ async def name(self, ctx, *, name: str): @commands.Cog.listener("on_member_join") async def role_persistance(self, member): """Automatically give already assigned roles on join""" + if await self.bot.cog_disabled_in_guild(self, member.guild): + return role = await self.config.member(member).role() if role: role = member.guild.get_role(role) From b182cbc0362f6c822f17c6684568c3bab4ab7037 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 10:37:31 +0400 Subject: [PATCH 08/17] [personalroles] min version --- personalroles/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/personalroles/info.json b/personalroles/info.json index aa39c597..e8109603 100644 --- a/personalroles/info.json +++ b/personalroles/info.json @@ -5,7 +5,7 @@ "install_msg": "Thanks for install.", "short": "Personal roles for members", "description": "Personal roles for members", - "min_bot_version": "3.2.1", + "min_bot_version": "3.4.0", "tags": [ "myrole", "personal role", From a5b347ef37b5e513d2f1f458b448b03b0042b60e Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 10:43:30 +0400 Subject: [PATCH 09/17] [translators] change `bot.http.request` workaround to `allowed_mentions` --- translators/info.json | 2 +- translators/translators.py | 13 ++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/translators/info.json b/translators/info.json index 04543873..61e67082 100644 --- a/translators/info.json +++ b/translators/info.json @@ -5,7 +5,7 @@ "install_msg": "Thanks for install.\nFor Yandex.Translate you will need to set apikey (`[p]ytapikey`)", "short": "Useful (and not) translators", "description": "Useful (and not) translators", - "min_bot_version": "3.2.1", + "min_bot_version": "3.4.0", "tags": [ "translation", "yandex", diff --git a/translators/translators.py b/translators/translators.py index ebefa7c4..9e1e9a21 100644 --- a/translators/translators.py +++ b/translators/translators.py @@ -44,7 +44,7 @@ class Translators(commands.Cog): """Useful (and not) translators""" - __version__ = "2.1.7" + __version__ = "2.1.8" # noinspection PyMissingConstructor def __init__(self, bot): @@ -365,14 +365,9 @@ async def emojify(self, ctx, *, message: str): .replace("#", "#\N{COMBINING ENCLOSING KEYCAP}") .replace("*", "*\N{COMBINING ENCLOSING KEYCAP}") ) - await self.bot.http.request( # TODO: Switch this to allowed_mentions in next release of Red with dpy 1.4 - discord.http.Route( - "POST", "/channels/{channel_id}/messages", channel_id=ctx.channel.id - ), - json={ - "content": message[:2000], - "allowed_mentions": {"parse": [], "roles": [], "users": []}, - }, + await ctx.send( + message, + allowed_mentions=discord.AllowedMentions(everyone=False, users=False, roles=False), ) @commands.group() From a2ca2d6f799a67d3bf269f1ae0f7b0e109cec78c Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 11:19:33 +0400 Subject: [PATCH 10/17] [adminutils] add support of roles to `prune` --- adminutils/adminutils.py | 14 ++++-- adminutils/info.json | 1 + adminutils/locales/messages.pot | 86 +++++++++++++-------------------- 3 files changed, 43 insertions(+), 58 deletions(-) diff --git a/adminutils/adminutils.py b/adminutils/adminutils.py index 8a6d1e04..8c1e0732 100644 --- a/adminutils/adminutils.py +++ b/adminutils/adminutils.py @@ -1,5 +1,6 @@ from asyncio import TimeoutError as AsyncTimeoutError from random import choice +from typing import Optional import aiohttp import discord @@ -16,7 +17,7 @@ class AdminUtils(commands.Cog): """Useful commands for server administrators.""" - __version__ = "2.4.0" + __version__ = "2.4.1" # noinspection PyMissingConstructor def __init__(self, bot): @@ -33,7 +34,7 @@ async def red_delete_data_for_user(self, **kwargs): @commands.guild_only() @checks.admin_or_permissions(kick_members=True) @checks.bot_has_permissions(kick_members=True) - async def cleanup_users(self, ctx, days: int = 1): + async def cleanup_users(self, ctx, days: Optional[int] = 1, *roles: discord.Role): """Cleanup inactive server members""" if days > 30: await ctx.send( @@ -50,12 +51,13 @@ async def cleanup_users(self, ctx, days: int = 1): to_kick = await ctx.guild.estimate_pruned_members(days=days) pred = MessagePredicate.yes_or_no(ctx) if not ctx.assume_yes: + roles_text = _("\nIncluding members in roles: {}\n").format(", ".join([r.mention for r in roles])) await ctx.send( chat.warning( _( "You about to kick **{to_kick}** inactive for **{days}** days members from this server. " - 'Are you sure?\nTo agree, type "yes"' - ).format(to_kick=to_kick, days=days) + '{roles}Are you sure?\nTo agree, type "yes"' + ).format(to_kick=to_kick, days=days, roles=roles_text if roles else "") ) ) try: @@ -63,7 +65,9 @@ async def cleanup_users(self, ctx, days: int = 1): except AsyncTimeoutError: pass if ctx.assume_yes or pred.result: - cleanup = await ctx.guild.prune_members(days=days, reason=get_audit_reason(ctx.author)) + cleanup = await ctx.guild.prune_members( + days=days, reason=get_audit_reason(ctx.author), roles=roles if roles else None + ) await ctx.send( chat.info( _( diff --git a/adminutils/info.json b/adminutils/info.json index 12b14990..ebd55aae 100644 --- a/adminutils/info.json +++ b/adminutils/info.json @@ -6,6 +6,7 @@ "install_msg": "Thanks for install.\nThis cog contains some useful commands for server administrators.", "short": "Useful commands for server administrators.", "description": "Useful commands for server administrators.", + "min_bot_version": "3.4.0", "tags": [ "admin", "emoj", diff --git a/adminutils/locales/messages.pot b/adminutils/locales/messages.pot index 3f89f2d3..f608e9a2 100644 --- a/adminutils/locales/messages.pot +++ b/adminutils/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-18 11:19+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,42 +11,48 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: adminutils\adminutils.py:19 +#: adminutils.py:18 #, docstring msgid "Useful commands for server administrators." msgstr "" -#: adminutils\adminutils.py:36 +#: adminutils.py:38 #, docstring msgid "Cleanup inactive server members" msgstr "" -#: adminutils\adminutils.py:40 +#: adminutils.py:42 msgid "" "Due to Discord Restrictions, you cannot use more than 30 days for that cmd." msgstr "" -#: adminutils\adminutils.py:47 +#: adminutils.py:49 msgid "\"days\" arg cannot be less than 1..." msgstr "" -#: adminutils\adminutils.py:54 +#: adminutils.py:54 msgid "" -"You about to kick **{to_kick}** inactive for **{days}** days members from this server. Are you sure?\n" +"\n" +"Including members in roles: {}\n" +msgstr "" + +#: adminutils.py:57 +msgid "" +"You about to kick **{to_kick}** inactive for **{days}** days members from this server. {roles}Are you sure?\n" "To agree, type \"yes\"" msgstr "" -#: adminutils\adminutils.py:68 +#: adminutils.py:73 msgid "" "**{removed}**/**{all}** inactive members removed.\n" "(They was inactive for **{days}** days)" msgstr "" -#: adminutils\adminutils.py:75 +#: adminutils.py:80 msgid "Inactive members cleanup canceled." msgstr "" -#: adminutils\adminutils.py:82 +#: adminutils.py:87 #, docstring msgid "" "Change server's voice region to random and back\n" @@ -54,11 +60,11 @@ msgid "" " Useful to reinitate all voice connections" msgstr "" -#: adminutils\adminutils.py:95 +#: adminutils.py:100 msgid "Voice restart" msgstr "" -#: adminutils\adminutils.py:107 +#: adminutils.py:112 #, docstring msgid "" "Move all members from one voice channel to another\n" @@ -66,58 +72,32 @@ msgid "" " Use double quotes if channel name has spaces" msgstr "" -#: adminutils\adminutils.py:113 +#: adminutils.py:118 msgid "There is no users in channel {}." msgstr "" -#: adminutils\adminutils.py:117 +#: adminutils.py:122 msgid "I cant move users from that channel" msgstr "" -#: adminutils\adminutils.py:120 +#: adminutils.py:125 msgid "I cant move users to that channel" msgstr "" -#: adminutils\adminutils.py:126 +#: adminutils.py:131 msgid "Massmove" msgstr "" -#: adminutils\adminutils.py:131 +#: adminutils.py:136 msgid "Finished moving users. {} members could not be moved." msgstr "" -#: adminutils\adminutils.py:139 -#, docstring -msgid "Mass nicknames everyone on the server" -msgstr "" - -#: adminutils\adminutils.py:146 -msgid "Massnick" -msgstr "" - -#: adminutils\adminutils.py:153 -msgid "Finished nicknaming server. {} nicknames could not be completed." -msgstr "" - -#: adminutils\adminutils.py:162 -#, docstring -msgid "Resets nicknames on the server" -msgstr "" - -#: adminutils\adminutils.py:169 -msgid "Reset nicks" -msgstr "" - -#: adminutils\adminutils.py:176 -msgid "Finished resetting server nicknames. Unable to reset {} nicknames." -msgstr "" - -#: adminutils\adminutils.py:184 +#: adminutils.py:143 #, docstring msgid "Manage emoji" msgstr "" -#: adminutils\adminutils.py:189 +#: adminutils.py:148 #, docstring msgid "" "Create custom emoji\n" @@ -130,23 +110,23 @@ msgid "" " " msgstr "" -#: adminutils\adminutils.py:201 +#: adminutils.py:160 msgid "Unable to get emoji from provided url: {}" msgstr "" -#: adminutils\adminutils.py:210 +#: adminutils.py:169 msgid "Restricted to roles: {}" msgstr "" -#: adminutils\adminutils.py:218 +#: adminutils.py:177 msgid "This image type is unsupported, or link is incorrect" msgstr "" -#: adminutils\adminutils.py:220 +#: adminutils.py:179 msgid "An error occured on adding an emoji: {}" msgstr "" -#: adminutils\adminutils.py:226 +#: adminutils.py:185 #, docstring msgid "" "Rename emoji and restrict to certain roles\n" @@ -160,15 +140,15 @@ msgid "" " " msgstr "" -#: adminutils\adminutils.py:244 +#: adminutils.py:203 msgid "Restricted to roles: " msgstr "" -#: adminutils\adminutils.py:252 +#: adminutils.py:211 msgid "I can't edit this emoji" msgstr "" -#: adminutils\adminutils.py:257 +#: adminutils.py:216 #, docstring msgid "Remove emoji from server" msgstr "" From edb351e6d199c45b7df942a8a28563b523c1fc9f Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 12:34:55 +0400 Subject: [PATCH 11/17] [datautils] even more data some additional data about guild in fetchwidget if it has invite enabled more data about servers: rules channels and public updates (usually stuff) channels "public flags" in uinfo --- datautils/datautils.py | 67 +++++-- datautils/info.json | 2 +- datautils/locales/messages.pot | 328 +++++++++++++++++---------------- 3 files changed, 226 insertions(+), 171 deletions(-) diff --git a/datautils/datautils.py b/datautils/datautils.py index 782b4dc1..6e7985bc 100644 --- a/datautils/datautils.py +++ b/datautils/datautils.py @@ -42,7 +42,7 @@ def bool_emojify(bool_var: bool) -> str: "WELCOME_SCREEN_ENABLED": _("Welcome screen"), "PUBLIC_DISABLED": _("Cannot be public"), "ENABLED_DISCOVERABLE_BEFORE": _("Was in Server Discovery"), - "COMMUNITY": _("Community (Public) server"), + "COMMUNITY": _("Community server"), } ACTIVITY_TYPES = { @@ -84,7 +84,7 @@ async def find_app_by_name(where: list, name: str): class DataUtils(commands.Cog): """Commands for getting information about users or servers.""" - __version__ = "2.4.2" + __version__ = "2.4.3" # noinspection PyMissingConstructor def __init__(self, bot): @@ -151,19 +151,41 @@ async def fetchwidget(self, ctx, *, server_id: int): invite = await widget.fetch_invite() except discord.HTTPException: invite = None - em = discord.Embed(title=_("Server info"), color=await ctx.embed_color(),) + em = discord.Embed( + title=_("Server info"), color=await ctx.embed_color(), url=widget.json_url + ) em.add_field(name=_("Name"), value=chat.escape(widget.name, formatting=True)) stats_text = _( "**Online member count:** {members}\n" "**Voice channel count:** {channels}" ).format(members=len(widget.members), channels=len(widget.channels)) if invite: + guild = invite.guild + em.description = guild.description and guild.description or None stats_text += "\n" + _( + "**Server ID**: {guild_id}\n" "**Approximate member count:** {approx_members}\n" - "**Approx. active members count:** {approx_active}" + "**Approx. active members count:** {approx_active}\n" + "**Invite Channel:** {channel}" ).format( + guild_id=guild.id, approx_members=invite.approximate_member_count, approx_active=invite.approximate_presence_count, + channel=chat.escape(invite.channel.name, formatting=True), ) + if guild.features: + em.add_field( + name=_("Features"), + value="\n".join(GUILD_FEATURES.get(f, f) for f in guild.features).format( + banner=guild.banner and f" [🔗]({guild.banner_url_as(format='png')})" or "", + splash=guild.splash and f" [🔗]({guild.splash_url_as(format='png')})" or "", + discovery=guild.discovery_splash + and f" [🔗]({guild.discovery_splash_url_as(format='png')})" + or "", + ), + inline=False, + ) + if invite.guild.icon: + em.set_image(url=invite.guild.icon_url_as(static_format="png", size=4096)) em.add_field(name=_("Stats"), value=stats_text, inline=False) if widget.invite_url: em.add_field(name=_("Widget's invite"), value=widget.invite_url) @@ -220,11 +242,20 @@ async def uinfo(self, ctx, *, member: discord.Member = None): value=f"{member.mention}\n{chat.inline(member.mention)}", inline=False, ) - em.add_field( - name=_("Roles"), - value="\n".join([role.name for role in member.roles if not role.is_default()]) or "❌", - inline=False, - ) + if roles := [role.name for role in member.roles if not role.is_default()]: + em.add_field( + name=_("Roles"), + value="\n".join(roles), + inline=False, + ) + if member.public_flags.value: + em.add_field( + name=_("Public flags"), + value="\n".join( + [str(flag)[10:].replace("_", " ").capitalize() for flag in member.public_flags.all()] + ), + inline=False, + ) em.set_image(url=member.avatar_url_as(static_format="png", size=4096)) # em.set_thumbnail(url=member.default_avatar_url) await ctx.send(embed=em) @@ -308,6 +339,16 @@ async def sinfo(self, ctx, *, server: commands.GuildConverter = None): else _("Unknown"), ) em.add_field(name=_("2FA admins"), value=bool_emojify(server.mfa_level)) + if server.rules_channel: + em.add_field( + name=_("Rules channel"), + value=chat.escape(server.rules_channel.name, formatting=True), + ) + if server.public_updates_channel: + em.add_field( + name=_("Public updates channel"), + value=chat.escape(server.public_updates_channel.name, formatting=True), + ) if server.system_channel: em.add_field( name=_("System messages channel"), @@ -316,7 +357,7 @@ async def sinfo(self, ctx, *, server: commands.GuildConverter = None): "**Welcome message:** {welcome}\n" "**Boosts:** {boost}" ).format( - channel=chat.escape(str(server.system_channel), formatting=True), + channel=chat.escape(server.system_channel.name, formatting=True), welcome=bool_emojify(server.system_channel_flags.join_notifications), boost=bool_emojify(server.system_channel_flags.premium_subscriptions), ), @@ -333,7 +374,8 @@ async def sinfo(self, ctx, *, server: commands.GuildConverter = None): "**Animated emoji count:** {animated_emojis}/{emoji_limit}\n" "**Boosters:** {boosters} ({boosts} **boosts**) (**Tier:** {tier}/3)\n" "**Max bitrate:** {bitrate} kbps\n" - "**Max filesize:** {files} MB" + "**Max filesize:** {files} MB\n" + "**Max users in voice with video:** {max_video}" ).format( shard=server.shard_id, members=server.member_count, @@ -348,6 +390,7 @@ async def sinfo(self, ctx, *, server: commands.GuildConverter = None): boosts=server.premium_subscription_count, bitrate=server.bitrate_limit / 1000, files=server.filesize_limit / 1048576, + max_video=server.max_video_channel_users, ), inline=False, ) @@ -715,6 +758,7 @@ async def activity_embed(self, ctx, activity: discord.Activity): timestamp=activity.start or discord.Embed.Empty, color=await ctx.embed_color(), ) + # noinspection PyUnresolvedReferences apps = await self.bot.http.request( discord.http.Route("GET", "/applications/detectable") ) @@ -740,6 +784,7 @@ async def activity_embed(self, ctx, activity: discord.Activity): f"{activity.state and activity.state or ''}{party_size}", color=await ctx.embed_color(), ) + # noinspection PyUnresolvedReferences apps = await self.bot.http.request( discord.http.Route("GET", "/applications/detectable") ) diff --git a/datautils/info.json b/datautils/info.json index fcefd504..26f28c44 100644 --- a/datautils/info.json +++ b/datautils/info.json @@ -14,7 +14,7 @@ "server", "permissions" ], - "min_bot_version": "3.3.6", + "min_bot_version": "3.4.0", "requirements": [ "matplotlib", "tabulate", diff --git a/datautils/locales/messages.pot b/datautils/locales/messages.pot index a01d9edf..85acdae3 100644 --- a/datautils/locales/messages.pot +++ b/datautils/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-18 12:30+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,335 +11,348 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: datautils\datautils.py:30 +#: datautils.py:29 msgid "384kbps voice bitrate" msgstr "" -#: datautils\datautils.py:31 +#: datautils.py:30 msgid "Vanity invite URL" msgstr "" -#: datautils\datautils.py:32 +#: datautils.py:31 msgid "Invite splash{splash}" msgstr "" -#: datautils\datautils.py:33 +#: datautils.py:32 msgid "Verified" msgstr "" -#: datautils\datautils.py:34 +#: datautils.py:33 msgid "Discord Partner" msgstr "" -#: datautils\datautils.py:35 +#: datautils.py:34 msgid "Extended emoji limit" msgstr "" -#: datautils\datautils.py:36 +#: datautils.py:35 msgid "Shows in Server Discovery{discovery}" msgstr "" -#: datautils\datautils.py:37 +#: datautils.py:36 msgid "Can be in \"Featured\" section of Server Discovery" msgstr "" -#: datautils\datautils.py:38 +#: datautils.py:37 msgid "Store channels" msgstr "" -#: datautils\datautils.py:39 -msgid "Can be joined without an invite" -msgstr "" - -#: datautils\datautils.py:40 +#: datautils.py:39 msgid "News channels" msgstr "" -#: datautils\datautils.py:41 +#: datautils.py:40 msgid "Banner{banner}" msgstr "" -#: datautils\datautils.py:42 +#: datautils.py:41 msgid "Animated icon" msgstr "" -#: datautils\datautils.py:43 +#: datautils.py:42 msgid "Welcome screen" msgstr "" -#: datautils\datautils.py:44 +#: datautils.py:43 msgid "Cannot be public" msgstr "" -#: datautils\datautils.py:45 +#: datautils.py:44 msgid "Was in Server Discovery" msgstr "" -#: datautils\datautils.py:50 +#: datautils.py:45 +msgid "Community server" +msgstr "" + +#: datautils.py:49 msgid "Playing" msgstr "" -#: datautils\datautils.py:51 +#: datautils.py:50 msgid "Watching" msgstr "" -#: datautils\datautils.py:52 +#: datautils.py:51 msgid "Listening" msgstr "" -#: datautils\datautils.py:86 +#: datautils.py:85 #, docstring msgid "Commands for getting information about users or servers." msgstr "" -#: datautils\datautils.py:93 +#: datautils.py:92 msgid "%d.%m.%Y %H:%M:%S %Z" msgstr "" -#: datautils\datautils.py:99 +#: datautils.py:101 #, docstring msgid "Get info about any Discord's user by ID" msgstr "" -#: datautils\datautils.py:103 +#: datautils.py:105 msgid "Discord user with ID `{}` not found" msgstr "" -#: datautils\datautils.py:108 +#: datautils.py:110 msgid "I was unable to get data about user with ID `{}`. Try again later" msgstr "" -#: datautils\datautils.py:119 datautils\datautils.py:432 -#: datautils\datautils.py:529 datautils\datautils.py:578 -#: datautils\datautils.py:672 +#: datautils.py:121 datautils.py:477 datautils.py:574 datautils.py:623 +#: datautils.py:717 msgid "ID" msgstr "" -#: datautils\datautils.py:120 datautils\datautils.py:206 +#: datautils.py:122 datautils.py:230 msgid "Bot?" msgstr "" -#: datautils\datautils.py:121 datautils\datautils.py:207 +#: datautils.py:123 datautils.py:231 msgid "System?" msgstr "" -#: datautils\datautils.py:122 datautils\datautils.py:217 -#: datautils\datautils.py:452 datautils\datautils.py:545 +#: datautils.py:124 datautils.py:241 datautils.py:497 datautils.py:590 msgid "Mention" msgstr "" -#: datautils\datautils.py:124 +#: datautils.py:126 msgid "Default avatar" msgstr "" -#: datautils\datautils.py:128 +#: datautils.py:130 msgid "Avatar" msgstr "" -#: datautils\datautils.py:133 +#: datautils.py:135 msgid "Created at" msgstr "" -#: datautils\datautils.py:139 +#: datautils.py:141 #, docstring msgid "Get data about server by ID via server's widget" msgstr "" -#: datautils\datautils.py:143 +#: datautils.py:145 msgid "Widget is disabled for this server." msgstr "" -#: datautils\datautils.py:146 +#: datautils.py:148 msgid "Widget for that server is not found: {}" msgstr "" -#: datautils\datautils.py:152 datautils\datautils.py:259 +#: datautils.py:155 datautils.py:292 msgid "Server info" msgstr "" -#: datautils\datautils.py:153 datautils\datautils.py:184 -#: datautils\datautils.py:263 datautils\datautils.py:578 +#: datautils.py:157 datautils.py:208 datautils.py:296 datautils.py:623 msgid "Name" msgstr "" -#: datautils\datautils.py:154 +#: datautils.py:158 msgid "" "**Online member count:** {members}\n" "**Voice channel count:** {channels}" msgstr "" -#: datautils\datautils.py:158 +#: datautils.py:164 msgid "" +"**Server ID**: {guild_id}\n" "**Approximate member count:** {approx_members}\n" -"**Approx. active members count:** {approx_active}" +"**Approx. active members count:** {approx_active}\n" +"**Invite Channel:** {channel}" msgstr "" -#: datautils\datautils.py:165 datautils\datautils.py:324 +#: datautils.py:177 datautils.py:399 +msgid "Features" +msgstr "" + +#: datautils.py:189 datautils.py:367 msgid "Stats" msgstr "" -#: datautils\datautils.py:167 datautils\datautils.py:365 +#: datautils.py:191 datautils.py:410 msgid "Widget's invite" msgstr "" -#: datautils\datautils.py:174 +#: datautils.py:198 #, docstring msgid "Information on a user" msgstr "" -#: datautils\datautils.py:182 +#: datautils.py:206 msgid "Nickname" msgstr "" -#: datautils\datautils.py:186 +#: datautils.py:210 msgid "Client" msgstr "" -#: datautils\datautils.py:195 +#: datautils.py:219 msgid "Joined server" msgstr "" -#: datautils\datautils.py:198 datautils\datautils.py:437 -#: datautils\datautils.py:537 datautils\datautils.py:677 -#: datautils\datautils.py:686 +#: datautils.py:222 datautils.py:482 datautils.py:582 datautils.py:722 +#: datautils.py:731 msgid "Has existed since" msgstr "" -#: datautils\datautils.py:201 datautils\datautils.py:542 +#: datautils.py:225 datautils.py:587 msgid "Color" msgstr "" -#: datautils\datautils.py:204 +#: datautils.py:228 msgid "Boosted server" msgstr "" -#: datautils\datautils.py:209 +#: datautils.py:233 msgid "Server permissions" msgstr "" -#: datautils\datautils.py:215 +#: datautils.py:239 msgid "In voice channel" msgstr "" -#: datautils\datautils.py:222 datautils\datautils.py:683 +#: datautils.py:247 datautils.py:728 msgid "Roles" msgstr "" -#: datautils\datautils.py:234 +#: datautils.py:253 +msgid "Public flags" +msgstr "" + +#: datautils.py:267 #, docstring msgid "List user's activities" msgstr "" -#: datautils\datautils.py:244 +#: datautils.py:277 msgid "Right now this user is doing nothing" msgstr "" -#: datautils\datautils.py:250 +#: datautils.py:283 #, docstring msgid "Shows server information" msgstr "" -#: datautils\datautils.py:264 +#: datautils.py:297 msgid "Server ID" msgstr "" -#: datautils\datautils.py:265 +#: datautils.py:298 msgid "Existed since" msgstr "" -#: datautils\datautils.py:266 +#: datautils.py:299 msgid "Region" msgstr "" -#: datautils\datautils.py:268 +#: datautils.py:301 msgid "Discovery language" msgstr "" -#: datautils\datautils.py:269 +#: datautils.py:302 msgid "Owner" msgstr "" -#: datautils\datautils.py:271 +#: datautils.py:304 msgid "AFK timeout and channel" msgstr "" -#: datautils\datautils.py:272 +#: datautils.py:305 msgid "{} min in {}" msgstr "" -#: datautils\datautils.py:277 +#: datautils.py:310 msgid "Verification level" msgstr "" -#: datautils\datautils.py:278 +#: datautils.py:311 msgid "None" msgstr "" -#: datautils\datautils.py:280 +#: datautils.py:313 msgid "Low" msgstr "" -#: datautils\datautils.py:282 +#: datautils.py:315 msgid "Medium" msgstr "" -#: datautils\datautils.py:284 +#: datautils.py:317 msgid "High" msgstr "" -#: datautils\datautils.py:286 +#: datautils.py:319 msgid "Highest" msgstr "" -#: datautils\datautils.py:288 datautils\datautils.py:298 -#: datautils\datautils.py:306 +#: datautils.py:321 datautils.py:331 datautils.py:339 msgid "Unknown" msgstr "" -#: datautils\datautils.py:291 +#: datautils.py:324 msgid "Explicit content filter" msgstr "" -#: datautils\datautils.py:292 +#: datautils.py:325 msgid "Don't scan any messages." msgstr "" -#: datautils\datautils.py:294 +#: datautils.py:327 msgid "Scan messages from members without a role." msgstr "" -#: datautils\datautils.py:296 +#: datautils.py:329 msgid "Scan messages sent by all members." msgstr "" -#: datautils\datautils.py:301 +#: datautils.py:334 msgid "Default notifications" msgstr "" -#: datautils\datautils.py:302 +#: datautils.py:335 msgid "All messages" msgstr "" -#: datautils\datautils.py:304 +#: datautils.py:337 msgid "Only @mentions" msgstr "" -#: datautils\datautils.py:308 +#: datautils.py:341 msgid "2FA admins" msgstr "" -#: datautils\datautils.py:311 +#: datautils.py:344 +msgid "Rules channel" +msgstr "" + +#: datautils.py:349 +msgid "Public updates channel" +msgstr "" + +#: datautils.py:354 msgid "System messages channel" msgstr "" -#: datautils\datautils.py:312 +#: datautils.py:355 msgid "" "**Channel:** {channel}\n" "**Welcome message:** {welcome}\n" "**Boosts:** {boost}" msgstr "" -#: datautils\datautils.py:325 +#: datautils.py:368 msgid "" "**Bot's shard:** {shard}\n" "**Member count:** {members}/{members_limit}\n" @@ -349,277 +362,274 @@ msgid "" "**Animated emoji count:** {animated_emojis}/{emoji_limit}\n" "**Boosters:** {boosters} ({boosts} **boosts**) (**Tier:** {tier}/3)\n" "**Max bitrate:** {bitrate} kbps\n" -"**Max filesize:** {files} MB" -msgstr "" - -#: datautils\datautils.py:354 -msgid "Features" +"**Max filesize:** {files} MB\n" +"**Max users in voice with video:** {max_video}" msgstr "" -#: datautils\datautils.py:374 +#: datautils.py:419 #, docstring msgid "Get bans from server by id" msgstr "" -#: datautils\datautils.py:378 +#: datautils.py:423 msgid "I need permission \"Ban Members\" to access banned members on server" msgstr "" -#: datautils\datautils.py:386 +#: datautils.py:431 msgid "Banlist is empty!" msgstr "" -#: datautils\datautils.py:393 +#: datautils.py:438 #, docstring msgid "Get invites from server by id" msgstr "" -#: datautils\datautils.py:398 +#: datautils.py:443 msgid "I need permission \"Manage Server\" to access list of invites on server" msgstr "" -#: datautils\datautils.py:406 +#: datautils.py:451 msgid "There is no invites for this server" msgstr "" -#: datautils\datautils.py:419 +#: datautils.py:464 #, docstring msgid "Get info about channel" msgstr "" -#: datautils\datautils.py:434 +#: datautils.py:479 msgid "Type" msgstr "" -#: datautils\datautils.py:440 +#: datautils.py:485 msgid "Category" msgstr "" -#: datautils\datautils.py:442 +#: datautils.py:487 msgid "Not in category" msgstr "" -#: datautils\datautils.py:444 datautils\datautils.py:541 +#: datautils.py:489 datautils.py:586 msgid "Position" msgstr "" -#: datautils\datautils.py:446 datautils\datautils.py:468 +#: datautils.py:491 datautils.py:513 msgid "Users" msgstr "" -#: datautils\datautils.py:448 +#: datautils.py:493 msgid "Changed roles permissions" msgstr "" -#: datautils\datautils.py:449 +#: datautils.py:494 msgid "Not set" msgstr "" -#: datautils\datautils.py:457 +#: datautils.py:502 msgid "Slowmode delay" msgstr "" -#: datautils\datautils.py:457 +#: datautils.py:502 msgid "{} seconds" msgstr "" -#: datautils\datautils.py:459 datautils\datautils.py:474 +#: datautils.py:504 datautils.py:519 msgid "NSFW" msgstr "" -#: datautils\datautils.py:464 +#: datautils.py:509 msgid "Webhooks count" msgstr "" -#: datautils\datautils.py:466 +#: datautils.py:511 msgid "Bitrate" msgstr "" -#: datautils\datautils.py:466 +#: datautils.py:511 msgid "{}kbps" msgstr "" -#: datautils\datautils.py:482 +#: datautils.py:527 #, docstring msgid "Get all channels on server" msgstr "" -#: datautils\datautils.py:485 +#: datautils.py:530 msgid "No categories" msgstr "" -#: datautils\datautils.py:486 +#: datautils.py:531 msgid "No text channels" msgstr "" -#: datautils\datautils.py:487 +#: datautils.py:532 msgid "No voice channels" msgstr "" -#: datautils\datautils.py:497 +#: datautils.py:542 msgid "Page {}/{} • Categories: {} • Total channels: {}" msgstr "" -#: datautils\datautils.py:505 +#: datautils.py:550 msgid "Page {}/{} • Text channels: {} • Total channels: {}" msgstr "" -#: datautils\datautils.py:513 +#: datautils.py:558 msgid "Page {}/{} • Voice channels: {} • Total channels: {}" msgstr "" -#: datautils\datautils.py:524 +#: datautils.py:569 #, docstring msgid "Get info about role" msgstr "" -#: datautils\datautils.py:531 +#: datautils.py:576 msgid "Permissions" msgstr "" -#: datautils\datautils.py:539 +#: datautils.py:584 msgid "Hoist" msgstr "" -#: datautils\datautils.py:540 +#: datautils.py:585 msgid "Members" msgstr "" -#: datautils\datautils.py:543 datautils\datautils.py:680 +#: datautils.py:588 datautils.py:725 msgid "Managed" msgstr "" -#: datautils\datautils.py:544 +#: datautils.py:589 msgid "Mentionable" msgstr "" -#: datautils\datautils.py:554 +#: datautils.py:599 #, docstring msgid "Get list of members that has provided role" msgstr "" -#: datautils\datautils.py:557 +#: datautils.py:602 msgid "There is no members in this role" msgstr "" -#: datautils\datautils.py:565 datautils\datautils.py:643 +#: datautils.py:610 datautils.py:688 msgid "Page {}/{}" msgstr "" -#: datautils\datautils.py:573 +#: datautils.py:618 #, docstring msgid "Get all roles on server" msgstr "" -#: datautils\datautils.py:594 +#: datautils.py:639 #, docstring msgid "Check user's permission for current or provided channel" msgstr "" -#: datautils\datautils.py:604 +#: datautils.py:649 msgid "No permissions" msgstr "" -#: datautils\datautils.py:613 +#: datautils.py:658 #, docstring msgid "Get info about emoji" msgstr "" -#: datautils\datautils.py:616 +#: datautils.py:661 msgid "React to this message with your emoji" msgstr "" -#: datautils\datautils.py:637 +#: datautils.py:682 #, docstring msgid "Get all emojis on server" msgstr "" -#: datautils\datautils.py:648 +#: datautils.py:693 msgid "No emojis on this server" msgstr "" -#: datautils\datautils.py:661 +#: datautils.py:706 msgid "Unicode character" msgstr "" -#: datautils\datautils.py:667 +#: datautils.py:712 msgid "Unicode category" msgstr "" -#: datautils\datautils.py:673 +#: datautils.py:718 msgid "Animated" msgstr "" -#: datautils\datautils.py:679 +#: datautils.py:724 msgid "\":\" required" msgstr "" -#: datautils\datautils.py:681 +#: datautils.py:726 msgid "Server" msgstr "" -#: datautils\datautils.py:689 +#: datautils.py:734 msgid "Custom emoji" msgstr "" -#: datautils\datautils.py:709 +#: datautils.py:754 msgid "Custom status" msgstr "" -#: datautils\datautils.py:712 +#: datautils.py:757 msgid "Playing {}" msgstr "" -#: datautils\datautils.py:728 +#: datautils.py:773 msgid "This game will end at" msgstr "" -#: datautils\datautils.py:731 +#: datautils.py:776 msgid "Playing since" msgstr "" -#: datautils\datautils.py:754 +#: datautils.py:799 msgid "Small image text" msgstr "" -#: datautils\datautils.py:757 +#: datautils.py:802 msgid "Application ID" msgstr "" -#: datautils\datautils.py:760 datautils\datautils.py:790 +#: datautils.py:805 datautils.py:835 msgid "Started at" msgstr "" -#: datautils\datautils.py:764 datautils\datautils.py:792 +#: datautils.py:809 datautils.py:837 msgid "Will end at" msgstr "" -#: datautils\datautils.py:768 +#: datautils.py:813 msgid "Large image text" msgstr "" -#: datautils\datautils.py:777 +#: datautils.py:822 msgid "Streaming on {}" msgstr "" -#: datautils\datautils.py:781 +#: datautils.py:826 msgid "Game" msgstr "" -#: datautils\datautils.py:785 +#: datautils.py:830 msgid "" "by {}\n" "on {}" msgstr "" -#: datautils\datautils.py:791 +#: datautils.py:836 msgid "Duration" msgstr "" -#: datautils\datautils.py:794 +#: datautils.py:839 msgid "Listening since" msgstr "" -#: datautils\datautils.py:796 +#: datautils.py:841 msgid "Unsupported activity type: {}" msgstr "" From 2b4a9c22a6d9ddec8f2732d378f47599ff6d0c90 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 13:28:43 +0400 Subject: [PATCH 12/17] [datautils] change format to static_format in serverinfo avatar --- datautils/datautils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datautils/datautils.py b/datautils/datautils.py index 6e7985bc..8933ae48 100644 --- a/datautils/datautils.py +++ b/datautils/datautils.py @@ -84,7 +84,7 @@ async def find_app_by_name(where: list, name: str): class DataUtils(commands.Cog): """Commands for getting information about users or servers.""" - __version__ = "2.4.3" + __version__ = "2.4.4" # noinspection PyMissingConstructor def __init__(self, bot): @@ -408,7 +408,7 @@ async def sinfo(self, ctx, *, server: commands.GuildConverter = None): ) if widget.invite_url: em.add_field(name=_("Widget's invite"), value=widget.invite_url) - em.set_image(url=server.icon_url_as(format="png", size=4096)) + em.set_image(url=server.icon_url_as(static_format="png", size=4096)) await ctx.send(embed=em) @commands.command() From d2411e47939807e4cc949a322b2ba3088936bf7e Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 18 Aug 2020 13:30:39 +0400 Subject: [PATCH 13/17] b l a c k --- adminutils/adminutils.py | 4 +++- datautils/datautils.py | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/adminutils/adminutils.py b/adminutils/adminutils.py index 8c1e0732..c0407ec8 100644 --- a/adminutils/adminutils.py +++ b/adminutils/adminutils.py @@ -51,7 +51,9 @@ async def cleanup_users(self, ctx, days: Optional[int] = 1, *roles: discord.Role to_kick = await ctx.guild.estimate_pruned_members(days=days) pred = MessagePredicate.yes_or_no(ctx) if not ctx.assume_yes: - roles_text = _("\nIncluding members in roles: {}\n").format(", ".join([r.mention for r in roles])) + roles_text = _("\nIncluding members in roles: {}\n").format( + ", ".join([r.mention for r in roles]) + ) await ctx.send( chat.warning( _( diff --git a/datautils/datautils.py b/datautils/datautils.py index 8933ae48..a6129835 100644 --- a/datautils/datautils.py +++ b/datautils/datautils.py @@ -244,15 +244,16 @@ async def uinfo(self, ctx, *, member: discord.Member = None): ) if roles := [role.name for role in member.roles if not role.is_default()]: em.add_field( - name=_("Roles"), - value="\n".join(roles), - inline=False, + name=_("Roles"), value="\n".join(roles), inline=False, ) if member.public_flags.value: em.add_field( name=_("Public flags"), value="\n".join( - [str(flag)[10:].replace("_", " ").capitalize() for flag in member.public_flags.all()] + [ + str(flag)[10:].replace("_", " ").capitalize() + for flag in member.public_flags.all() + ] ), inline=False, ) From 3f1f91b88d49bbd64d95d459c79bd508fbc1a063 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Sat, 22 Aug 2020 12:37:37 +0400 Subject: [PATCH 14/17] end_user_data_statement in jsons --- adminutils/info.json | 3 +- datautils/info.json | 3 +- generalchannel/info.json | 3 +- generalchannel/locales/messages.pot | 26 ++--- godvilledata/info.json | 3 +- godvilledata/locales/messages.pot | 10 +- massthings/info.json | 1 + massthings/locales/messages.pot | 47 +++++--- messageslog/info.json | 3 +- minecraftdata/info.json | 3 +- minecraftdata/locales/messages.pot | 90 ++++++++-------- moreutils/info.json | 3 +- moreutils/locales/messages.pot | 26 ++--- personalroles/info.json | 3 +- reverseimagesearch/info.json | 3 +- reverseimagesearch/locales/messages.pot | 56 +++++----- smmdata/info.json | 3 +- smmdata/locales/messages.pot | 50 ++++----- steamcommunity/info.json | 3 +- steamcommunity/locales/messages.pot | 92 ++++++++-------- translators/info.json | 3 +- weather/info.json | 3 +- weather/locales/messages.pot | 136 ++++++++++++------------ 23 files changed, 303 insertions(+), 270 deletions(-) diff --git a/adminutils/info.json b/adminutils/info.json index ebd55aae..6748da8d 100644 --- a/adminutils/info.json +++ b/adminutils/info.json @@ -12,5 +12,6 @@ "emoj", "purge", "massnick" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/datautils/info.json b/datautils/info.json index 26f28c44..de07c77d 100644 --- a/datautils/info.json +++ b/datautils/info.json @@ -19,5 +19,6 @@ "matplotlib", "tabulate", "wcwidth" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/generalchannel/info.json b/generalchannel/info.json index 9f6ef6ba..b26958dc 100644 --- a/generalchannel/info.json +++ b/generalchannel/info.json @@ -10,5 +10,6 @@ "channel", "name", "topic" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/generalchannel/locales/messages.pot b/generalchannel/locales/messages.pot index f62396a7..d3a58488 100644 --- a/generalchannel/locales/messages.pot +++ b/generalchannel/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,22 +11,22 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: generalchannel\generalchannel.py:22 +#: generalchannel\generalchannel.py:21 #, docstring msgid "Allow users to manage #general channel's name and topic" msgstr "" -#: generalchannel\generalchannel.py:36 +#: generalchannel\generalchannel.py:38 #, docstring msgid "Change general server's channel name/topic" msgstr "" -#: generalchannel\generalchannel.py:42 +#: generalchannel\generalchannel.py:44 #, docstring msgid "Set general channel" msgstr "" -#: generalchannel\generalchannel.py:47 +#: generalchannel\generalchannel.py:49 #, docstring msgid "" "Set #general channel\n" @@ -34,24 +34,24 @@ msgid "" " Clears setting if channel not specified" msgstr "" -#: generalchannel\generalchannel.py:61 +#: generalchannel\generalchannel.py:63 #, docstring msgid "Change name of #general" msgstr "" -#: generalchannel\generalchannel.py:68 +#: generalchannel\generalchannel.py:70 msgid "General channel name change" msgstr "" -#: generalchannel\generalchannel.py:71 +#: generalchannel\generalchannel.py:73 msgid "Unable to change channel's name: Missing permissions" msgstr "" -#: generalchannel\generalchannel.py:74 +#: generalchannel\generalchannel.py:76 msgid "Unable to change channel's name: Failed: {}" msgstr "" -#: generalchannel\generalchannel.py:83 +#: generalchannel\generalchannel.py:85 #, docstring msgid "" "Change topic of #general\n" @@ -60,14 +60,14 @@ msgid "" " to end of topic" msgstr "" -#: generalchannel\generalchannel.py:100 +#: generalchannel\generalchannel.py:102 msgid "General channel topic change" msgstr "" -#: generalchannel\generalchannel.py:103 +#: generalchannel\generalchannel.py:105 msgid "Unable to change channel's topic: Missing permissions" msgstr "" -#: generalchannel\generalchannel.py:106 +#: generalchannel\generalchannel.py:108 msgid "Unable to change channel's topic: Failed: {}" msgstr "" diff --git a/godvilledata/info.json b/godvilledata/info.json index 36876ed2..20352fa0 100644 --- a/godvilledata/info.json +++ b/godvilledata/info.json @@ -11,5 +11,6 @@ ], "requirements": [ "python-dateutil" - ] + ], + "red_end_user_data_statement": "This cog stores https://godville.net API-tokens if provided by user.\nUsers may delete their tokens by either via `[p]godville apikey remove` or via data removal request." } \ No newline at end of file diff --git a/godvilledata/locales/messages.pot b/godvilledata/locales/messages.pot index d8e89c07..6b00df04 100644 --- a/godvilledata/locales/messages.pot +++ b/godvilledata/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,17 +11,17 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: godvilledata\godvilledata.py:66 +#: godvilledata\godvilledata.py:69 #, docstring msgid "Get data about godville.net (Russian) god by name" msgstr "" -#: godvilledata\godvilledata.py:182 +#: godvilledata\godvilledata.py:185 #, docstring msgid "Get data about godvillegame.com (Global) god by name" msgstr "" -#: godvilledata\godvilledata.py:298 +#: godvilledata\godvilledata.py:301 #, docstring msgid "" "Set apikey for your character.\n" @@ -29,7 +29,7 @@ msgid "" " Only one character per user" msgstr "" -#: godvilledata\godvilledata.py:307 +#: godvilledata\godvilledata.py:310 #, docstring msgid "Remove your apikey and godname from bot's data" msgstr "" diff --git a/massthings/info.json b/massthings/info.json index bce230ae..0a6102e0 100644 --- a/massthings/info.json +++ b/massthings/info.json @@ -8,5 +8,6 @@ "tags": [], "min_bot_version": "3.0.0", "requirements": ["tabulate"], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users.", "hidden": true } \ No newline at end of file diff --git a/massthings/locales/messages.pot b/massthings/locales/messages.pot index 71f89d27..73fa0ea4 100644 --- a/massthings/locales/messages.pot +++ b/massthings/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-31 16:46+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,7 +11,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: massthings.py:19 +#: massthings\massthings.py:20 #, docstring msgid "" "Cog for doing things in bulk.\n" @@ -20,61 +20,80 @@ msgid "" " I'm not responsible for any aftermath of using this cog." msgstr "" -#: massthings.py:38 +#: massthings\massthings.py:39 msgid "" "This command may abuse Discord API and therefore, ban you or bot's owner, " "are you sure that you want to proceed?" msgstr "" -#: massthings.py:56 +#: massthings\massthings.py:60 #, docstring msgid "Mass nicknames everyone on the server" msgstr "" -#: massthings.py:63 +#: massthings\massthings.py:67 msgid "Massnick" msgstr "" -#: massthings.py:70 +#: massthings\massthings.py:74 msgid "Finished nicknaming server. {} nicknames could not be completed." msgstr "" -#: massthings.py:79 +#: massthings\massthings.py:83 #, docstring msgid "Resets nicknames on the server" msgstr "" -#: massthings.py:86 +#: massthings\massthings.py:90 msgid "Reset nicks" msgstr "" -#: massthings.py:93 +#: massthings\massthings.py:97 msgid "Finished resetting server nicknames. Unable to reset {} nicknames." msgstr "" -#: massthings.py:105 +#: massthings\massthings.py:109 #, docstring msgid "Steal all emoji provided in arguments" msgstr "" -#: massthings.py:117 +#: massthings\massthings.py:121 msgid "" "You tried to add too many emojis, you can add only {} emojis more to this server\n" "You tried to add {}." msgstr "" -#: massthings.py:127 +#: massthings\massthings.py:131 msgid "" "You tried to add too many animated emojis, you can add only {} emojis more to this server.\n" "You tried to add {}." msgstr "" -#: massthings.py:141 +#: massthings\massthings.py:145 msgid "Emoji steal" msgstr "" -#: massthings.py:152 +#: massthings\massthings.py:156 msgid "" "Stealed emojis:\n" "{}" msgstr "" + +#: massthings\massthings.py:169 +#, docstring +msgid "" +"Unban all users that banned by specified user\n" +"\n" +" Uses modlog data, since discord not saves author of ban." +msgstr "" + +#: massthings\massthings.py:190 massthings\massthings.py:216 +msgid "" +"Unbanned users:\n" +"{}" +msgstr "" + +#: massthings\massthings.py:200 +#, docstring +msgid "Unban everyone from current guild" +msgstr "" diff --git a/messageslog/info.json b/messageslog/info.json index 31ed2dff..3b66eff7 100644 --- a/messageslog/info.json +++ b/messageslog/info.json @@ -9,5 +9,6 @@ "tags": [ "messages", "logs" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/minecraftdata/info.json b/minecraftdata/info.json index 721b4d05..5a7d966e 100644 --- a/minecraftdata/info.json +++ b/minecraftdata/info.json @@ -13,5 +13,6 @@ "tabulate", "wcwidth", "mcstatus" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/minecraftdata/locales/messages.pot b/minecraftdata/locales/messages.pot index 89bd4c1f..a8ee4a7e 100644 --- a/minecraftdata/locales/messages.pot +++ b/minecraftdata/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,195 +11,195 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: minecraftdata\minecraftdata.py:23 +#: minecraftdata\minecraftdata.py:22 msgid "💔 **UNAVAILABLE**" msgstr "" -#: minecraftdata\minecraftdata.py:24 +#: minecraftdata\minecraftdata.py:23 msgid "💛 **SOME ISSUES**" msgstr "" -#: minecraftdata\minecraftdata.py:25 +#: minecraftdata\minecraftdata.py:24 msgid "💚 **OK**" msgstr "" -#: minecraftdata\minecraftdata.py:31 +#: minecraftdata\minecraftdata.py:30 #, docstring msgid "Minecraft-Related data" msgstr "" -#: minecraftdata\minecraftdata.py:45 +#: minecraftdata\minecraftdata.py:47 #, docstring msgid "Get Minecraft-Related data" msgstr "" -#: minecraftdata\minecraftdata.py:51 +#: minecraftdata\minecraftdata.py:53 #, docstring msgid "Get minecraft skin by nickname" msgstr "" -#: minecraftdata\minecraftdata.py:77 +#: minecraftdata\minecraftdata.py:79 msgid "Unable to get data from Crafatar: {}" msgstr "" -#: minecraftdata\minecraftdata.py:88 +#: minecraftdata\minecraftdata.py:90 msgid "Provided by Crafatar" msgstr "" -#: minecraftdata\minecraftdata.py:94 +#: minecraftdata\minecraftdata.py:96 #, docstring msgid "Get Minecraft capes by nickname" msgstr "" -#: minecraftdata\minecraftdata.py:101 +#: minecraftdata\minecraftdata.py:103 msgid "{} doesn't have cape" msgstr "" -#: minecraftdata\minecraftdata.py:103 +#: minecraftdata\minecraftdata.py:105 msgid "Unable to get cape: {}" msgstr "" -#: minecraftdata\minecraftdata.py:112 +#: minecraftdata\minecraftdata.py:114 #, docstring msgid "Get OptiFine cape by nickname" msgstr "" -#: minecraftdata\minecraftdata.py:119 +#: minecraftdata\minecraftdata.py:121 msgid "{} doesn't have OptiFine cape" msgstr "" -#: minecraftdata\minecraftdata.py:123 +#: minecraftdata\minecraftdata.py:125 msgid "Unable to get {player}'s OptiFine cape: {message}" msgstr "" -#: minecraftdata\minecraftdata.py:136 +#: minecraftdata\minecraftdata.py:138 #, docstring msgid "Get LabyMod cape by nickname" msgstr "" -#: minecraftdata\minecraftdata.py:145 +#: minecraftdata\minecraftdata.py:147 msgid "{} doesn't have LabyMod cape" msgstr "" -#: minecraftdata\minecraftdata.py:149 +#: minecraftdata\minecraftdata.py:151 msgid "Unable to get data: {message} ({status})" msgstr "" -#: minecraftdata\minecraftdata.py:162 +#: minecraftdata\minecraftdata.py:164 #, docstring msgid "Get MinecraftCapes.co.uk cape by nickname" msgstr "" -#: minecraftdata\minecraftdata.py:170 +#: minecraftdata\minecraftdata.py:172 msgid "{} doesn't have MinecraftCapes cape" msgstr "" -#: minecraftdata\minecraftdata.py:175 +#: minecraftdata\minecraftdata.py:177 msgid "Unable to get {player}'s MinecraftCapes cape: {message}" msgstr "" -#: minecraftdata\minecraftdata.py:188 +#: minecraftdata\minecraftdata.py:190 #, docstring msgid "Get 5zig cape by nickname" msgstr "" -#: minecraftdata\minecraftdata.py:198 minecraftdata\minecraftdata.py:230 +#: minecraftdata\minecraftdata.py:200 minecraftdata\minecraftdata.py:232 msgid "{} doesn't have 5zig cape" msgstr "" -#: minecraftdata\minecraftdata.py:202 minecraftdata\minecraftdata.py:234 +#: minecraftdata\minecraftdata.py:204 minecraftdata\minecraftdata.py:236 msgid "Unable to get {player}'s 5zig cape: {message}" msgstr "" -#: minecraftdata\minecraftdata.py:215 +#: minecraftdata\minecraftdata.py:217 #, docstring msgid "Get 5zig animated cape by nickname" msgstr "" -#: minecraftdata\minecraftdata.py:224 +#: minecraftdata\minecraftdata.py:226 msgid "{} doesn't have animated 5zig cape" msgstr "" -#: minecraftdata\minecraftdata.py:249 +#: minecraftdata\minecraftdata.py:251 #, docstring msgid "Get info about server" msgstr "" -#: minecraftdata\minecraftdata.py:253 +#: minecraftdata\minecraftdata.py:255 msgid "Unable to resolve IP: {}" msgstr "" -#: minecraftdata\minecraftdata.py:259 +#: minecraftdata\minecraftdata.py:261 msgid "Unable to get server's status: {}" msgstr "" -#: minecraftdata\minecraftdata.py:277 +#: minecraftdata\minecraftdata.py:279 msgid "Latency" msgstr "" -#: minecraftdata\minecraftdata.py:279 +#: minecraftdata\minecraftdata.py:281 msgid "Players" msgstr "" -#: minecraftdata\minecraftdata.py:297 +#: minecraftdata\minecraftdata.py:299 msgid "Version" msgstr "" -#: minecraftdata\minecraftdata.py:298 +#: minecraftdata\minecraftdata.py:300 msgid "" "{}\n" "Protocol: {}" msgstr "" -#: minecraftdata\minecraftdata.py:301 +#: minecraftdata\minecraftdata.py:303 msgid "World" msgstr "" -#: minecraftdata\minecraftdata.py:303 +#: minecraftdata\minecraftdata.py:305 msgid "Software" msgstr "" -#: minecraftdata\minecraftdata.py:304 +#: minecraftdata\minecraftdata.py:306 msgid "" "{}\n" "Version: {}" msgstr "" -#: minecraftdata\minecraftdata.py:312 +#: minecraftdata\minecraftdata.py:314 #, docstring msgid "Get status of minecraft services" msgstr "" -#: minecraftdata\minecraftdata.py:317 +#: minecraftdata\minecraftdata.py:319 msgid "Status of minecraft services" msgstr "" -#: minecraftdata\minecraftdata.py:328 +#: minecraftdata\minecraftdata.py:330 msgid "Unable to check. An error has been occurred: {}" msgstr "" -#: minecraftdata\minecraftdata.py:336 +#: minecraftdata\minecraftdata.py:338 #, docstring msgid "Check history of player's nicks" msgstr "" -#: minecraftdata\minecraftdata.py:347 +#: minecraftdata\minecraftdata.py:349 msgid "%d.%m.%Y %H:%M:%S" msgstr "" -#: minecraftdata\minecraftdata.py:349 +#: minecraftdata\minecraftdata.py:351 msgid "Initial" msgstr "" -#: minecraftdata\minecraftdata.py:352 +#: minecraftdata\minecraftdata.py:354 msgid "Nickname" msgstr "" -#: minecraftdata\minecraftdata.py:352 +#: minecraftdata\minecraftdata.py:354 msgid "Changed to at... (UTC)" msgstr "" -#: minecraftdata\minecraftdata.py:360 +#: minecraftdata\minecraftdata.py:362 msgid "" "Unable to check name history.\n" "An error has been occurred: " diff --git a/moreutils/info.json b/moreutils/info.json index c3114202..b39e685f 100644 --- a/moreutils/info.json +++ b/moreutils/info.json @@ -14,5 +14,6 @@ ], "requirements": [ "python-dateutil" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/moreutils/locales/messages.pot b/moreutils/locales/messages.pot index 20887c5c..3ee87170 100644 --- a/moreutils/locales/messages.pot +++ b/moreutils/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,26 +11,26 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: moreutils\moreutils.py:45 +#: moreutils\moreutils.py:44 #, docstring msgid "Some (maybe) useful utils." msgstr "" -#: moreutils\moreutils.py:59 +#: moreutils\moreutils.py:61 #, docstring msgid "Send bot's current time" msgstr "" -#: moreutils\moreutils.py:60 +#: moreutils\moreutils.py:62 msgid "%d.%m.%Y %H:%M:%S %Z" msgstr "" -#: moreutils\moreutils.py:65 +#: moreutils\moreutils.py:67 #, docstring msgid "Shows some info about provided color" msgstr "" -#: moreutils\moreutils.py:104 +#: moreutils\moreutils.py:106 #, docstring msgid "" "Help I've fallen and I need @someone.\n" @@ -38,31 +38,31 @@ msgid "" " Discord 2018 April Fools" msgstr "" -#: moreutils\moreutils.py:133 +#: moreutils\moreutils.py:135 #, docstring msgid "Get current discord status from status.discordapp.com" msgstr "" -#: moreutils\moreutils.py:142 +#: moreutils\moreutils.py:144 msgid "Unable to get data from https://status.discordapp.com: {}" msgstr "" -#: moreutils\moreutils.py:148 +#: moreutils\moreutils.py:150 msgid "OK" msgstr "" -#: moreutils\moreutils.py:149 +#: moreutils\moreutils.py:151 msgid "Minor problems" msgstr "" -#: moreutils\moreutils.py:150 +#: moreutils\moreutils.py:152 msgid "Major problems" msgstr "" -#: moreutils\moreutils.py:151 +#: moreutils\moreutils.py:153 msgid "Critical problems" msgstr "" -#: moreutils\moreutils.py:155 +#: moreutils\moreutils.py:157 msgid "Discord Status" msgstr "" diff --git a/personalroles/info.json b/personalroles/info.json index e8109603..1a2023d8 100644 --- a/personalroles/info.json +++ b/personalroles/info.json @@ -13,5 +13,6 @@ ], "requirements": [ "tabulate" - ] + ], + "red_end_user_data_statement": "This cog stores users data in form of «member : role» Discord IDs pairings.\nThis cog supports data removal requests." } \ No newline at end of file diff --git a/reverseimagesearch/info.json b/reverseimagesearch/info.json index 34a8469b..d56f1cba 100644 --- a/reverseimagesearch/info.json +++ b/reverseimagesearch/info.json @@ -16,5 +16,6 @@ "requirements": [ "python-dateutil", "pillow>=6" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/reverseimagesearch/locales/messages.pot b/reverseimagesearch/locales/messages.pot index 52ab76d1..336d0ef7 100644 --- a/reverseimagesearch/locales/messages.pot +++ b/reverseimagesearch/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -24,44 +24,44 @@ msgstr "" msgid "(Anime) Reverse Image Search" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:42 +#: reverseimagesearch\reverseimagesearch.py:45 #, docstring msgid "Reverse search image via SauceNAO" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:56 -#: reverseimagesearch\reverseimagesearch.py:95 -#: reverseimagesearch\reverseimagesearch.py:200 +#: reverseimagesearch\reverseimagesearch.py:59 +#: reverseimagesearch\reverseimagesearch.py:98 +#: reverseimagesearch\reverseimagesearch.py:203 msgid "Nothing found" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:75 +#: reverseimagesearch\reverseimagesearch.py:78 msgid "Similarity: {}%" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:77 +#: reverseimagesearch\reverseimagesearch.py:80 msgid "Part/Episode: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:78 +#: reverseimagesearch\reverseimagesearch.py:81 msgid "Year: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:79 -#: reverseimagesearch\reverseimagesearch.py:178 +#: reverseimagesearch\reverseimagesearch.py:82 +#: reverseimagesearch\reverseimagesearch.py:181 msgid "Est. Time: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:87 +#: reverseimagesearch\reverseimagesearch.py:90 msgid "Via SauceNAO • Page {}/{}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:100 +#: reverseimagesearch\reverseimagesearch.py:103 #, docstring msgid "Set API key for SauceNAO" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:101 +#: reverseimagesearch\reverseimagesearch.py:104 msgid "" "To get SauceNAO API key:\n" "1. [Login](https://saucenao.com/user.php) to your SauceNAO account\n" @@ -73,7 +73,7 @@ msgid "" "or in DM with the bot." msgstr "" -#: reverseimagesearch\reverseimagesearch.py:115 +#: reverseimagesearch\reverseimagesearch.py:118 #, docstring msgid "" "Set API count of results count for SauceNAO\n" @@ -81,23 +81,23 @@ msgid "" " 6 by default" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:124 +#: reverseimagesearch\reverseimagesearch.py:127 #, docstring msgid "See how many requests are left" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:127 +#: reverseimagesearch\reverseimagesearch.py:130 msgid "" "Remaining requests:\n" "Short (30 seconds): {}/{}\n" "Long: (24 hours): {}/{}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:137 +#: reverseimagesearch\reverseimagesearch.py:140 msgid "Command `{}` has not been used yet" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:141 +#: reverseimagesearch\reverseimagesearch.py:144 #, docstring msgid "" "Reverse search image via WAIT\n" @@ -105,44 +105,44 @@ msgid "" " If search performed not in NSFW channel, NSFW results will be not shown" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:169 +#: reverseimagesearch\reverseimagesearch.py:172 msgid "Similarity: {:.2f}%" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:171 +#: reverseimagesearch\reverseimagesearch.py:174 msgid "Native title: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:173 +#: reverseimagesearch\reverseimagesearch.py:176 msgid "Romaji transcription: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:175 +#: reverseimagesearch\reverseimagesearch.py:178 msgid "Chinese title: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:177 +#: reverseimagesearch\reverseimagesearch.py:180 msgid "English title: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:179 +#: reverseimagesearch\reverseimagesearch.py:182 msgid "Episode: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:181 +#: reverseimagesearch\reverseimagesearch.py:184 msgid "Also known as: {}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:193 +#: reverseimagesearch\reverseimagesearch.py:196 msgid "Via WAIT (trace.moe) • Page {}/{}" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:205 +#: reverseimagesearch\reverseimagesearch.py:208 #, docstring msgid "See how many requests are left and time until reset" msgstr "" -#: reverseimagesearch\reverseimagesearch.py:208 +#: reverseimagesearch\reverseimagesearch.py:211 msgid "" "Remaining requests (ratelimit): {}/{}\n" "Remaining requests (quota): {}/{}\n" diff --git a/smmdata/info.json b/smmdata/info.json index bcb08946..4ee9aef2 100644 --- a/smmdata/info.json +++ b/smmdata/info.json @@ -12,5 +12,6 @@ ], "requirements": [ "beautifulsoup4" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/smmdata/locales/messages.pot b/smmdata/locales/messages.pot index cc94e876..faa572b1 100644 --- a/smmdata/locales/messages.pot +++ b/smmdata/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -28,101 +28,101 @@ msgstr "" msgid "Super Mario Maker-related data" msgstr "" -#: smmdata\smmdata.py:31 +#: smmdata\smmdata.py:34 #, docstring msgid "Get Super Mario Maker-related data" msgstr "" -#: smmdata\smmdata.py:36 +#: smmdata\smmdata.py:39 #, docstring msgid "Get info about SMM level" msgstr "" -#: smmdata\smmdata.py:44 +#: smmdata\smmdata.py:47 msgid "Game Style" msgstr "" -#: smmdata\smmdata.py:45 +#: smmdata\smmdata.py:48 msgid "Stars" msgstr "" -#: smmdata\smmdata.py:46 +#: smmdata\smmdata.py:49 msgid "Unique Players" msgstr "" -#: smmdata\smmdata.py:47 +#: smmdata\smmdata.py:50 msgid "Share count" msgstr "" -#: smmdata\smmdata.py:48 +#: smmdata\smmdata.py:51 msgid "Clears" msgstr "" -#: smmdata\smmdata.py:51 +#: smmdata\smmdata.py:54 msgid "First clear" msgstr "" -#: smmdata\smmdata.py:55 +#: smmdata\smmdata.py:58 msgid "World record" msgstr "" -#: smmdata\smmdata.py:56 +#: smmdata\smmdata.py:59 msgid "{time} by [{player}]({url})" msgstr "" -#: smmdata\smmdata.py:70 +#: smmdata\smmdata.py:73 #, docstring msgid "Get info about levels maker" msgstr "" -#: smmdata\smmdata.py:77 +#: smmdata\smmdata.py:80 msgid "Stars Received" msgstr "" -#: smmdata\smmdata.py:78 +#: smmdata\smmdata.py:81 msgid "Medals Earned" msgstr "" -#: smmdata\smmdata.py:79 +#: smmdata\smmdata.py:82 msgid "Uploaded Courses" msgstr "" -#: smmdata\smmdata.py:80 +#: smmdata\smmdata.py:83 msgid "100 Mario Challenge" msgstr "" -#: smmdata\smmdata.py:81 +#: smmdata\smmdata.py:84 msgid "Easy clears" msgstr "" -#: smmdata\smmdata.py:82 +#: smmdata\smmdata.py:85 msgid "Normal clears" msgstr "" -#: smmdata\smmdata.py:83 +#: smmdata\smmdata.py:86 msgid "Expert clears" msgstr "" -#: smmdata\smmdata.py:84 +#: smmdata\smmdata.py:87 msgid "Super Expert clears" msgstr "" -#: smmdata\smmdata.py:85 +#: smmdata\smmdata.py:88 msgid "Play History" msgstr "" -#: smmdata\smmdata.py:86 +#: smmdata\smmdata.py:89 msgid "Courses played" msgstr "" -#: smmdata\smmdata.py:87 +#: smmdata\smmdata.py:90 msgid "Courses cleared" msgstr "" -#: smmdata\smmdata.py:88 +#: smmdata\smmdata.py:91 msgid "Total plays" msgstr "" -#: smmdata\smmdata.py:89 +#: smmdata\smmdata.py:92 msgid "Lives lost" msgstr "" diff --git a/steamcommunity/info.json b/steamcommunity/info.json index 34d366b9..c8a3fc38 100644 --- a/steamcommunity/info.json +++ b/steamcommunity/info.json @@ -12,5 +12,6 @@ ], "requirements": [ "python-valve" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/steamcommunity/locales/messages.pot b/steamcommunity/locales/messages.pot index 6b39caac..16c2cd30 100644 --- a/steamcommunity/locales/messages.pot +++ b/steamcommunity/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,17 +11,17 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: steamcommunity\steamcommunity.py:115 steamcommunity\steamcommunity.py:137 +#: steamcommunity\steamcommunity.py:113 steamcommunity\steamcommunity.py:138 #, docstring msgid "SteamCommunity commands" msgstr "" -#: steamcommunity\steamcommunity.py:143 +#: steamcommunity\steamcommunity.py:144 #, docstring msgid "Set API key for Steam Web API" msgstr "" -#: steamcommunity\steamcommunity.py:144 +#: steamcommunity\steamcommunity.py:145 msgid "" "To get Steam Web API key:\n" "1. Login to your Steam account\n" @@ -33,111 +33,111 @@ msgid "" "or in DM with the bot." msgstr "" -#: steamcommunity\steamcommunity.py:161 +#: steamcommunity\steamcommunity.py:162 #, docstring msgid "Get steam user's steamcommunity profile" msgstr "" -#: steamcommunity\steamcommunity.py:172 +#: steamcommunity\steamcommunity.py:173 msgid "In game: [{}](http://store.steampowered.com/app/{})" msgstr "" -#: steamcommunity\steamcommunity.py:176 +#: steamcommunity\steamcommunity.py:177 msgid " on server {}" msgstr "" -#: steamcommunity\steamcommunity.py:178 +#: steamcommunity\steamcommunity.py:179 msgid "" "\n" "Family Shared by [{}]({})" msgstr "" -#: steamcommunity\steamcommunity.py:182 +#: steamcommunity\steamcommunity.py:183 msgid "Real name" msgstr "" -#: steamcommunity\steamcommunity.py:183 +#: steamcommunity\steamcommunity.py:184 msgid "Level" msgstr "" -#: steamcommunity\steamcommunity.py:185 +#: steamcommunity\steamcommunity.py:186 msgid "Country" msgstr "" -#: steamcommunity\steamcommunity.py:186 +#: steamcommunity\steamcommunity.py:187 msgid "Visibility" msgstr "" -#: steamcommunity\steamcommunity.py:189 +#: steamcommunity\steamcommunity.py:190 msgid "Created at" msgstr "" -#: steamcommunity\steamcommunity.py:191 +#: steamcommunity\steamcommunity.py:192 msgid "%d.%m.%Y %H:%M:%S" msgstr "" -#: steamcommunity\steamcommunity.py:197 +#: steamcommunity\steamcommunity.py:198 msgid "Days since last ban: {}" msgstr "" -#: steamcommunity\steamcommunity.py:199 +#: steamcommunity\steamcommunity.py:200 msgid "Has one or more bans:" msgstr "" -#: steamcommunity\steamcommunity.py:201 +#: steamcommunity\steamcommunity.py:202 msgid "No bans on record" msgstr "" -#: steamcommunity\steamcommunity.py:202 +#: steamcommunity\steamcommunity.py:203 msgid "🛡 Bans" msgstr "" -#: steamcommunity\steamcommunity.py:203 +#: steamcommunity\steamcommunity.py:204 msgid "Community ban" msgstr "" -#: steamcommunity\steamcommunity.py:205 +#: steamcommunity\steamcommunity.py:206 msgid "Economy ban" msgstr "" -#: steamcommunity\steamcommunity.py:209 +#: steamcommunity\steamcommunity.py:210 msgid "VAC bans" msgstr "" -#: steamcommunity\steamcommunity.py:210 +#: steamcommunity\steamcommunity.py:211 msgid "{} VAC bans" msgstr "" -#: steamcommunity\steamcommunity.py:213 +#: steamcommunity\steamcommunity.py:214 msgid "Game bans" msgstr "" -#: steamcommunity\steamcommunity.py:214 +#: steamcommunity\steamcommunity.py:215 msgid "{} game bans" msgstr "" -#: steamcommunity\steamcommunity.py:218 +#: steamcommunity\steamcommunity.py:219 msgid "Powered by Steam • Last seen on" msgstr "" -#: steamcommunity\steamcommunity.py:227 +#: steamcommunity\steamcommunity.py:228 #, docstring msgid "Get status of steam services" msgstr "" -#: steamcommunity\steamcommunity.py:237 +#: steamcommunity\steamcommunity.py:238 msgid "Unable to get data from steamstat.us: {} ({})" msgstr "" -#: steamcommunity\steamcommunity.py:244 +#: steamcommunity\steamcommunity.py:245 msgid "Unable to get data from steamstat.us: {}" msgstr "" -#: steamcommunity\steamcommunity.py:248 +#: steamcommunity\steamcommunity.py:249 msgid "Steam Status" msgstr "" -#: steamcommunity\steamcommunity.py:253 +#: steamcommunity\steamcommunity.py:254 msgid "" "**Online**: {}\n" "**In-game**: {}\n" @@ -148,11 +148,11 @@ msgid "" "**SteamDB.info database**: {}" msgstr "" -#: steamcommunity\steamcommunity.py:271 +#: steamcommunity\steamcommunity.py:272 msgid "Games" msgstr "" -#: steamcommunity\steamcommunity.py:272 +#: steamcommunity\steamcommunity.py:273 msgid "" "**TF2 Game Coordinator**: {}\n" "**Dota 2 Game Coordinator**: {}\n" @@ -164,60 +164,60 @@ msgid "" "**CS:GO Matchmaking Scheduler**: {}\n" msgstr "" -#: steamcommunity\steamcommunity.py:302 +#: steamcommunity\steamcommunity.py:303 #, docstring msgid "Get info about a gameserver" msgstr "" -#: steamcommunity\steamcommunity.py:312 +#: steamcommunity\steamcommunity.py:313 msgid "The specified domain is not valid: {}" msgstr "" -#: steamcommunity\steamcommunity.py:336 +#: steamcommunity\steamcommunity.py:337 msgid "Could not fetch Server or the Server is not on the Steam masterlist" msgstr "" -#: steamcommunity\steamcommunity.py:341 +#: steamcommunity\steamcommunity.py:342 msgid "An Error has been occurred: {}" msgstr "" -#: steamcommunity\steamcommunity.py:368 +#: steamcommunity\steamcommunity.py:369 msgid "Game" msgstr "" -#: steamcommunity\steamcommunity.py:370 +#: steamcommunity\steamcommunity.py:371 msgid "Gamemode" msgstr "" -#: steamcommunity\steamcommunity.py:371 +#: steamcommunity\steamcommunity.py:372 msgid "Server name" msgstr "" -#: steamcommunity\steamcommunity.py:372 +#: steamcommunity\steamcommunity.py:373 msgid "Map" msgstr "" -#: steamcommunity\steamcommunity.py:374 +#: steamcommunity\steamcommunity.py:375 msgid "Operating System" msgstr "" -#: steamcommunity\steamcommunity.py:375 +#: steamcommunity\steamcommunity.py:376 msgid "Server type" msgstr "" -#: steamcommunity\steamcommunity.py:376 +#: steamcommunity\steamcommunity.py:377 msgid "Version" msgstr "" -#: steamcommunity\steamcommunity.py:379 +#: steamcommunity\steamcommunity.py:380 msgid "Password" msgstr "" -#: steamcommunity\steamcommunity.py:383 steamcommunity\steamcommunity.py:387 +#: steamcommunity\steamcommunity.py:384 steamcommunity\steamcommunity.py:388 msgid "Players" msgstr "" -#: steamcommunity\steamcommunity.py:384 +#: steamcommunity\steamcommunity.py:385 msgid "" "{}/{}\n" "Bots: {}" diff --git a/translators/info.json b/translators/info.json index 61e67082..a2e22b6f 100644 --- a/translators/info.json +++ b/translators/info.json @@ -10,5 +10,6 @@ "translation", "yandex", "translate" - ] + ], + "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/weather/info.json b/weather/info.json index 4426cf57..3411eba8 100644 --- a/weather/info.json +++ b/weather/info.json @@ -13,5 +13,6 @@ ], "requirements": [ "python-forecastio" - ] + ], + "red_end_user_data_statement": "This cog may store data about user's preferred measuring units.\nThis data can be remove by either via `[p]forecastunits reset` or via data removal request." } \ No newline at end of file diff --git a/weather/locales/messages.pot b/weather/locales/messages.pot index 4c454238..ed4f93ce 100644 --- a/weather/locales/messages.pot +++ b/weather/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,77 +11,77 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: weather\weather.py:96 weather\weather.py:104 +#: weather\weather.py:92 weather\weather.py:100 msgid "km" msgstr "" -#: weather\weather.py:97 weather\weather.py:105 weather\weather.py:113 +#: weather\weather.py:93 weather\weather.py:101 weather\weather.py:109 msgid "mm/h" msgstr "" -#: weather\weather.py:98 weather\weather.py:106 weather\weather.py:114 +#: weather\weather.py:94 weather\weather.py:102 weather\weather.py:110 msgid "cm" msgstr "" -#: weather\weather.py:99 weather\weather.py:107 weather\weather.py:115 +#: weather\weather.py:95 weather\weather.py:103 weather\weather.py:111 msgid "℃" msgstr "" -#: weather\weather.py:100 +#: weather\weather.py:96 msgid "m/s" msgstr "" -#: weather\weather.py:101 weather\weather.py:109 weather\weather.py:117 +#: weather\weather.py:97 weather\weather.py:105 weather\weather.py:113 msgid "hPa" msgstr "" -#: weather\weather.py:108 +#: weather\weather.py:104 msgid "km/h" msgstr "" -#: weather\weather.py:112 weather\weather.py:120 +#: weather\weather.py:108 weather\weather.py:116 msgid "mi" msgstr "" -#: weather\weather.py:116 weather\weather.py:124 +#: weather\weather.py:112 weather\weather.py:120 msgid "mph" msgstr "" -#: weather\weather.py:121 weather\weather.py:122 +#: weather\weather.py:117 weather\weather.py:118 msgid "″" msgstr "" -#: weather\weather.py:123 +#: weather\weather.py:119 msgid "℉" msgstr "" -#: weather\weather.py:125 +#: weather\weather.py:121 msgid "mbar" msgstr "" -#: weather\weather.py:129 +#: weather\weather.py:125 msgid "Rain" msgstr "" -#: weather\weather.py:129 +#: weather\weather.py:125 msgid "Snow" msgstr "" -#: weather\weather.py:129 +#: weather\weather.py:125 msgid "Sleet" msgstr "" -#: weather\weather.py:134 +#: weather\weather.py:130 #, docstring msgid "Weather forecast" msgstr "" -#: weather\weather.py:152 +#: weather\weather.py:151 #, docstring msgid "Set API key for forecast.io" msgstr "" -#: weather\weather.py:153 +#: weather\weather.py:152 msgid "" "To get forecast.io API key:\n" "1. Find your [\"Your Secret Key\"](https://darksky.net/dev/account)\n" @@ -89,7 +89,7 @@ msgid "" "Note: DarkSky API is going to close at end of 2021. Im already aware of this issue and will change API later. For now you can use cog with already existing API keys." msgstr "" -#: weather\weather.py:165 +#: weather\weather.py:164 #, docstring msgid "" "Set forecast units for yourself\n" @@ -102,19 +102,19 @@ msgid "" " reset - reset your unit preference" msgstr "" -#: weather\weather.py:177 weather\weather.py:188 +#: weather\weather.py:176 weather\weather.py:187 msgid "Your current units are: {}" msgstr "" -#: weather\weather.py:179 +#: weather\weather.py:178 msgid "Not set, using server's default {}" msgstr "" -#: weather\weather.py:202 +#: weather\weather.py:201 msgid "Units \"{}\" are not supported, check {}help forecastunits" msgstr "" -#: weather\weather.py:215 +#: weather\weather.py:214 #, docstring msgid "" "Set forecast units for this guild\n" @@ -126,185 +126,185 @@ msgid "" " ca - Same as si, but speed in km/h" msgstr "" -#: weather\weather.py:225 +#: weather\weather.py:224 msgid "Current units are: {}" msgstr "" -#: weather\weather.py:233 +#: weather\weather.py:232 msgid "Units \"{}\" are not supported, check {}help forecastunits guild" msgstr "" -#: weather\weather.py:246 +#: weather\weather.py:245 #, docstring msgid "Shows weather in provided place" msgstr "" -#: weather\weather.py:261 weather\weather.py:385 +#: weather\weather.py:260 weather\weather.py:384 msgid "Cannot find a place {}. OSM returned {}" msgstr "" -#: weather\weather.py:268 weather\weather.py:392 +#: weather\weather.py:267 weather\weather.py:391 msgid "Cannot find a place {}" msgstr "" -#: weather\weather.py:286 weather\weather.py:410 +#: weather\weather.py:285 weather\weather.py:409 msgid "" "This command requires API key. Use {}forecastapi to get more information" msgstr "" -#: weather\weather.py:294 weather\weather.py:418 +#: weather\weather.py:293 weather\weather.py:417 msgid "Unable to get data from forecast.io" msgstr "" -#: weather\weather.py:299 weather\weather.py:425 +#: weather\weather.py:298 weather\weather.py:424 msgid "Weather in {}" msgstr "" -#: weather\weather.py:302 weather\weather.py:429 +#: weather\weather.py:301 weather\weather.py:428 msgid "[View on Google Maps](https://www.google.com/maps/place/{},{})" msgstr "" -#: weather\weather.py:308 weather\weather.py:435 +#: weather\weather.py:307 weather\weather.py:434 msgid "Powered by Dark Sky" msgstr "" -#: weather\weather.py:310 weather\weather.py:443 +#: weather\weather.py:309 weather\weather.py:442 msgid "Summary" msgstr "" -#: weather\weather.py:316 weather\weather.py:447 +#: weather\weather.py:315 weather\weather.py:446 msgid "Temperature" msgstr "" -#: weather\weather.py:321 weather\weather.py:452 +#: weather\weather.py:320 weather\weather.py:451 msgid "Air pressure" msgstr "" -#: weather\weather.py:326 weather\weather.py:457 +#: weather\weather.py:325 weather\weather.py:456 msgid "Humidity" msgstr "" -#: weather\weather.py:328 weather\weather.py:459 +#: weather\weather.py:327 weather\weather.py:458 msgid "Visibility" msgstr "" -#: weather\weather.py:334 weather\weather.py:465 +#: weather\weather.py:333 weather\weather.py:464 msgid "Wind speed" msgstr "" -#: weather\weather.py:341 weather\weather.py:472 +#: weather\weather.py:340 weather\weather.py:471 msgid "Cloud cover" msgstr "" -#: weather\weather.py:343 weather\weather.py:474 +#: weather\weather.py:342 weather\weather.py:473 msgid "Ozone density" msgstr "" -#: weather\weather.py:346 weather\weather.py:477 +#: weather\weather.py:345 weather\weather.py:476 msgid "UV index" msgstr "" -#: weather\weather.py:352 weather\weather.py:487 +#: weather\weather.py:351 weather\weather.py:486 msgid "Precipitation" msgstr "" -#: weather\weather.py:353 weather\weather.py:488 +#: weather\weather.py:352 weather\weather.py:487 msgid "Probability: {}%\n" msgstr "" -#: weather\weather.py:354 weather\weather.py:489 +#: weather\weather.py:353 weather\weather.py:488 msgid "Intensity: {} {}" msgstr "" -#: weather\weather.py:360 weather\weather.py:495 +#: weather\weather.py:359 weather\weather.py:494 msgid "" "\n" "Type: {}" msgstr "" -#: weather\weather.py:370 +#: weather\weather.py:369 #, docstring msgid "Shows 7 days forecast for provided place" msgstr "" -#: weather\weather.py:436 +#: weather\weather.py:435 msgid "Page {}/8" msgstr "" -#: weather\weather.py:441 +#: weather\weather.py:440 msgid "No summary for this day" msgstr "" -#: weather\weather.py:500 +#: weather\weather.py:499 msgid "" "\n" "Snowfall accumulation: {} {}" msgstr "" -#: weather\weather.py:506 +#: weather\weather.py:505 msgid "Moon phase" msgstr "" -#: weather\weather.py:542 +#: weather\weather.py:541 msgid "N" msgstr "" -#: weather\weather.py:543 +#: weather\weather.py:542 msgid "NNE" msgstr "" -#: weather\weather.py:544 +#: weather\weather.py:543 msgid "NE" msgstr "" -#: weather\weather.py:545 +#: weather\weather.py:544 msgid "ENE" msgstr "" -#: weather\weather.py:546 +#: weather\weather.py:545 msgid "E" msgstr "" -#: weather\weather.py:547 +#: weather\weather.py:546 msgid "ESE" msgstr "" -#: weather\weather.py:548 +#: weather\weather.py:547 msgid "SE" msgstr "" -#: weather\weather.py:549 +#: weather\weather.py:548 msgid "SSE" msgstr "" -#: weather\weather.py:550 +#: weather\weather.py:549 msgid "S" msgstr "" -#: weather\weather.py:551 +#: weather\weather.py:550 msgid "SSW" msgstr "" -#: weather\weather.py:552 +#: weather\weather.py:551 msgid "SW" msgstr "" -#: weather\weather.py:553 +#: weather\weather.py:552 msgid "WSW" msgstr "" -#: weather\weather.py:554 +#: weather\weather.py:553 msgid "W" msgstr "" -#: weather\weather.py:555 +#: weather\weather.py:554 msgid "WNW" msgstr "" -#: weather\weather.py:556 +#: weather\weather.py:555 msgid "NW" msgstr "" -#: weather\weather.py:557 +#: weather\weather.py:556 msgid "NNW" msgstr "" From 11e98ff1c85c801974f2fd05a74ee43d72b5643b Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Sat, 22 Aug 2020 12:46:09 +0400 Subject: [PATCH 15/17] end_user_data_statement in jsons im dumb as fuck --- adminutils/info.json | 2 +- datautils/info.json | 2 +- generalchannel/info.json | 2 +- godvilledata/info.json | 2 +- leveler/locales/messages.pot | 134 +++++++++++++++++------------------ massthings/info.json | 2 +- messageslog/info.json | 2 +- minecraftdata/info.json | 2 +- moreutils/info.json | 2 +- personalroles/info.json | 2 +- reverseimagesearch/info.json | 2 +- smmdata/info.json | 2 +- steamcommunity/info.json | 2 +- translators/info.json | 2 +- weather/info.json | 2 +- 15 files changed, 81 insertions(+), 81 deletions(-) diff --git a/adminutils/info.json b/adminutils/info.json index 6748da8d..f0565a67 100644 --- a/adminutils/info.json +++ b/adminutils/info.json @@ -13,5 +13,5 @@ "purge", "massnick" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/datautils/info.json b/datautils/info.json index de07c77d..806e9a0f 100644 --- a/datautils/info.json +++ b/datautils/info.json @@ -20,5 +20,5 @@ "tabulate", "wcwidth" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/generalchannel/info.json b/generalchannel/info.json index b26958dc..683884c2 100644 --- a/generalchannel/info.json +++ b/generalchannel/info.json @@ -11,5 +11,5 @@ "name", "topic" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/godvilledata/info.json b/godvilledata/info.json index 20352fa0..b7d4568b 100644 --- a/godvilledata/info.json +++ b/godvilledata/info.json @@ -12,5 +12,5 @@ "requirements": [ "python-dateutil" ], - "red_end_user_data_statement": "This cog stores https://godville.net API-tokens if provided by user.\nUsers may delete their tokens by either via `[p]godville apikey remove` or via data removal request." + "end_user_data_statement": "This cog stores https://godville.net API-tokens if provided by user.\nUsers may delete their tokens by either via `[p]godville apikey remove` or via data removal request." } \ No newline at end of file diff --git a/leveler/locales/messages.pot b/leveler/locales/messages.pot index 3cfe1d63..c0354695 100644 --- a/leveler/locales/messages.pot +++ b/leveler/locales/messages.pot @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2020-07-23 15:59+0400\n" +"POT-Creation-Date: 2020-08-09 13:37+0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -11,17 +11,17 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" "Generated-By: redgettext 3.3\n" -#: leveler\leveler.py:178 +#: leveler\leveler.py:175 #, docstring msgid "Displays a user profile." msgstr "" -#: leveler\leveler.py:243 +#: leveler\leveler.py:240 #, docstring msgid "Displays the rank of a user." msgstr "" -#: leveler\leveler.py:302 +#: leveler\leveler.py:299 #, docstring msgid "" "Displays leaderboard.\n" @@ -29,17 +29,17 @@ msgid "" " Add -global parameter for global and -rep for reputation." msgstr "" -#: leveler\leveler.py:437 +#: leveler\leveler.py:434 #, docstring msgid "Gives a reputation point to a designated player." msgstr "" -#: leveler\leveler.py:491 +#: leveler\leveler.py:488 #, docstring msgid "Gives more specific details about user profile image." msgstr "" -#: leveler\leveler.py:559 +#: leveler\leveler.py:556 #, docstring msgid "" "\n" @@ -49,47 +49,47 @@ msgid "" " " msgstr "" -#: leveler\leveler.py:574 +#: leveler\leveler.py:571 #, docstring msgid "Set the MongoDB server host." msgstr "" -#: leveler\leveler.py:591 +#: leveler\leveler.py:588 #, docstring msgid "Set the MongoDB server port." msgstr "" -#: leveler\leveler.py:608 +#: leveler\leveler.py:605 #, docstring msgid "Set the MongoDB server credentials." msgstr "" -#: leveler\leveler.py:622 +#: leveler\leveler.py:619 #, docstring msgid "Set the MongoDB db name." msgstr "" -#: leveler\leveler.py:635 +#: leveler\leveler.py:632 #, docstring msgid "Profile configuration Options." msgstr "" -#: leveler\leveler.py:640 +#: leveler\leveler.py:637 #, docstring msgid "Profile options." msgstr "" -#: leveler\leveler.py:645 +#: leveler\leveler.py:642 #, docstring msgid "Rank options." msgstr "" -#: leveler\leveler.py:650 +#: leveler\leveler.py:647 #, docstring msgid "Level-Up options." msgstr "" -#: leveler\leveler.py:655 +#: leveler\leveler.py:652 #, docstring msgid "" "Set profile color.\n" @@ -99,7 +99,7 @@ msgid "" " e.g: `[p]lvlset profile color all #eb4034`" msgstr "" -#: leveler\leveler.py:799 +#: leveler\leveler.py:796 #, docstring msgid "" "Set rank color.\n" @@ -109,7 +109,7 @@ msgid "" " e.g: `[p]lvlset rank color info white`" msgstr "" -#: leveler\leveler.py:907 +#: leveler\leveler.py:904 #, docstring msgid "" "Set levelup color.\n" @@ -119,42 +119,42 @@ msgid "" " e.g: `[p]lvlset color info default`" msgstr "" -#: leveler\leveler.py:1034 +#: leveler\leveler.py:1031 #, docstring msgid "Set your user info." msgstr "" -#: leveler\leveler.py:1058 +#: leveler\leveler.py:1055 #, docstring msgid "Set your level-up background." msgstr "" -#: leveler\leveler.py:1088 +#: leveler\leveler.py:1085 #, docstring msgid "Set your profile background." msgstr "" -#: leveler\leveler.py:1118 +#: leveler\leveler.py:1115 #, docstring msgid "Set your rank background." msgstr "" -#: leveler\leveler.py:1148 +#: leveler\leveler.py:1145 #, docstring msgid "Set your title." msgstr "" -#: leveler\leveler.py:1173 +#: leveler\leveler.py:1170 #, docstring msgid "Admin options features." msgstr "" -#: leveler\leveler.py:1179 +#: leveler\leveler.py:1176 #, docstring msgid "A list of settings." msgstr "" -#: leveler\leveler.py:1221 +#: leveler\leveler.py:1218 #, docstring msgid "" "Credits per message logged.\n" @@ -162,7 +162,7 @@ msgid "" " Default to `0`." msgstr "" -#: leveler\leveler.py:1236 +#: leveler\leveler.py:1233 #, docstring msgid "" "Blocks exp gain in certain channel.\n" @@ -170,7 +170,7 @@ msgid "" " Use command without channel to see list of ignored channels." msgstr "" -#: leveler\leveler.py:1262 +#: leveler\leveler.py:1259 #, docstring msgid "" "Locks levelup messages to one channel.\n" @@ -178,47 +178,47 @@ msgid "" " Disable command via locked channel." msgstr "" -#: leveler\leveler.py:1313 +#: leveler\leveler.py:1310 #, docstring msgid "Set a price for background changes." msgstr "" -#: leveler\leveler.py:1324 +#: leveler\leveler.py:1321 #, docstring msgid "Set a user's level. (What a cheater C:)." msgstr "" -#: leveler\leveler.py:1374 +#: leveler\leveler.py:1371 #, docstring msgid "Ban user from getting experience." msgstr "" -#: leveler\leveler.py:1405 +#: leveler\leveler.py:1402 #, docstring msgid "Toggle mentions on messages." msgstr "" -#: leveler\leveler.py:1428 +#: leveler\leveler.py:1425 #, docstring msgid "Toggle most leveler commands on the current server." msgstr "" -#: leveler\leveler.py:1441 +#: leveler\leveler.py:1438 #, docstring msgid "Toggle text-based messages on the server." msgstr "" -#: leveler\leveler.py:1454 +#: leveler\leveler.py:1451 #, docstring msgid "Toggle level-up messages on the server." msgstr "" -#: leveler\leveler.py:1468 +#: leveler\leveler.py:1465 #, docstring msgid "Toggles level-up alert in private message to the user." msgstr "" -#: leveler\leveler.py:1480 +#: leveler\leveler.py:1477 #, docstring msgid "" "Set the range for the XP given on each successful XP gain.\n" @@ -226,7 +226,7 @@ msgid "" " Leaving the entries blank will reset the XP to the default (Min: 15 - Max: 20)." msgstr "" -#: leveler\leveler.py:1502 +#: leveler\leveler.py:1499 #, docstring msgid "" "Set minimum message length for XP gain.\n" @@ -234,12 +234,12 @@ msgid "" " Messages with attachments will give XP regardless of length" msgstr "" -#: leveler\leveler.py:1512 +#: leveler\leveler.py:1509 #, docstring msgid "Badge Configuration Options." msgstr "" -#: leveler\leveler.py:1518 +#: leveler\leveler.py:1515 #, docstring msgid "" "Get a list of available badges.\n" @@ -248,12 +248,12 @@ msgid "" " Defaults for server." msgstr "" -#: leveler\leveler.py:1569 +#: leveler\leveler.py:1566 #, docstring msgid "Get all badges of a user." msgstr "" -#: leveler\leveler.py:1620 +#: leveler\leveler.py:1617 #, docstring msgid "" "Buy a badge.\n" @@ -261,7 +261,7 @@ msgid "" " Option: `-global`." msgstr "" -#: leveler\leveler.py:1703 +#: leveler\leveler.py:1700 #, docstring msgid "" "Set a badge to profile.\n" @@ -272,7 +272,7 @@ msgid "" " Maximum to `5000`." msgstr "" -#: leveler\leveler.py:1748 +#: leveler\leveler.py:1745 #, docstring msgid "" "Add a badge.\n" @@ -288,12 +288,12 @@ msgid "" " If you are the bot owner, you can `-global` to the description to make the badge available everywhere." msgstr "" -#: leveler\leveler.py:1859 +#: leveler\leveler.py:1856 #, docstring msgid "Define if badge must be circle or bars." msgstr "" -#: leveler\leveler.py:1879 +#: leveler\leveler.py:1876 #, docstring msgid "" "Delete a badge and remove from all users.\n" @@ -301,7 +301,7 @@ msgid "" " Option : `-global`." msgstr "" -#: leveler\leveler.py:1932 +#: leveler\leveler.py:1929 #, docstring msgid "" "Give a user a badge with a certain name\n" @@ -309,7 +309,7 @@ msgid "" " Indicate the user and the badge's name." msgstr "" -#: leveler\leveler.py:1973 +#: leveler\leveler.py:1970 #, docstring msgid "" "Take a user's badge.\n" @@ -317,7 +317,7 @@ msgid "" " Indicate the user and the badge's name." msgstr "" -#: leveler\leveler.py:2016 +#: leveler\leveler.py:2013 #, docstring msgid "" "Associate a badge with a level.\n" @@ -325,22 +325,22 @@ msgid "" " Indicate the badge's name and the level." msgstr "" -#: leveler\leveler.py:2050 +#: leveler\leveler.py:2047 #, docstring msgid "Delete a badge/level association." msgstr "" -#: leveler\leveler.py:2073 +#: leveler\leveler.py:2070 #, docstring msgid "List level/badge associations." msgstr "" -#: leveler\leveler.py:2106 +#: leveler\leveler.py:2103 #, docstring msgid "Admin role configuration." msgstr "" -#: leveler\leveler.py:2115 +#: leveler\leveler.py:2112 #, docstring msgid "" "Associate a role with a level.\n" @@ -348,22 +348,22 @@ msgid "" " Removes previous role if given." msgstr "" -#: leveler\leveler.py:2158 +#: leveler\leveler.py:2155 #, docstring msgid "Delete a role/level association." msgstr "" -#: leveler\leveler.py:2183 +#: leveler\leveler.py:2180 #, docstring msgid "List level/role associations." msgstr "" -#: leveler\leveler.py:2221 +#: leveler\leveler.py:2218 #, docstring msgid "Admin background configuration" msgstr "" -#: leveler\leveler.py:2228 +#: leveler\leveler.py:2225 #, docstring msgid "" "Add a profile background. \n" @@ -371,7 +371,7 @@ msgid "" " The proportions must be 290px x 290px." msgstr "" -#: leveler\leveler.py:2245 +#: leveler\leveler.py:2242 #, docstring msgid "" "Add a rank background.\n" @@ -379,7 +379,7 @@ msgid "" " The proportions must be 360px x 100px." msgstr "" -#: leveler\leveler.py:2262 +#: leveler\leveler.py:2259 #, docstring msgid "" "Add a level-up background.\n" @@ -387,7 +387,7 @@ msgid "" " The proportions must be 175px x 65px." msgstr "" -#: leveler\leveler.py:2279 +#: leveler\leveler.py:2276 #, docstring msgid "" "Set one-time custom background\n" @@ -395,22 +395,22 @@ msgid "" " bg_type can be: `profile`, `rank` or `levelup`." msgstr "" -#: leveler\leveler.py:2308 +#: leveler\leveler.py:2305 #, docstring msgid "Delete a profile background." msgstr "" -#: leveler\leveler.py:2320 +#: leveler\leveler.py:2317 #, docstring msgid "Delete a rank background." msgstr "" -#: leveler\leveler.py:2332 +#: leveler\leveler.py:2329 #, docstring msgid "Delete a level background." msgstr "" -#: leveler\leveler.py:2343 +#: leveler\leveler.py:2340 #, docstring msgid "" "Gives a list of backgrounds.\n" @@ -418,12 +418,12 @@ msgid "" " type can be: `profile`, `rank` or `levelup`." msgstr "" -#: leveler\leveler.py:2397 +#: leveler\leveler.py:2394 #, docstring msgid "Manage mee6 conversions." msgstr "" -#: leveler\leveler.py:2403 +#: leveler\leveler.py:2400 #, docstring msgid "" "Convert Mee6 levels.\n" @@ -431,7 +431,7 @@ msgid "" " This command must be run in a channel in the guild to be converted." msgstr "" -#: leveler\leveler.py:2478 +#: leveler\leveler.py:2475 #, docstring msgid "" "Convert Mee6 role rewards.\n" diff --git a/massthings/info.json b/massthings/info.json index 0a6102e0..3a7143aa 100644 --- a/massthings/info.json +++ b/massthings/info.json @@ -8,6 +8,6 @@ "tags": [], "min_bot_version": "3.0.0", "requirements": ["tabulate"], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users.", + "end_user_data_statement": "This cog does not persistently store data or metadata about users.", "hidden": true } \ No newline at end of file diff --git a/messageslog/info.json b/messageslog/info.json index 3b66eff7..35a11c50 100644 --- a/messageslog/info.json +++ b/messageslog/info.json @@ -10,5 +10,5 @@ "messages", "logs" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/minecraftdata/info.json b/minecraftdata/info.json index 5a7d966e..7159e47d 100644 --- a/minecraftdata/info.json +++ b/minecraftdata/info.json @@ -14,5 +14,5 @@ "wcwidth", "mcstatus" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/moreutils/info.json b/moreutils/info.json index b39e685f..561aa58e 100644 --- a/moreutils/info.json +++ b/moreutils/info.json @@ -15,5 +15,5 @@ "requirements": [ "python-dateutil" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/personalroles/info.json b/personalroles/info.json index 1a2023d8..c674ce68 100644 --- a/personalroles/info.json +++ b/personalroles/info.json @@ -14,5 +14,5 @@ "requirements": [ "tabulate" ], - "red_end_user_data_statement": "This cog stores users data in form of «member : role» Discord IDs pairings.\nThis cog supports data removal requests." + "end_user_data_statement": "This cog stores users data in form of «member : role» Discord IDs pairings.\nThis cog supports data removal requests." } \ No newline at end of file diff --git a/reverseimagesearch/info.json b/reverseimagesearch/info.json index d56f1cba..f28b8c35 100644 --- a/reverseimagesearch/info.json +++ b/reverseimagesearch/info.json @@ -17,5 +17,5 @@ "python-dateutil", "pillow>=6" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/smmdata/info.json b/smmdata/info.json index 4ee9aef2..c2b8df7a 100644 --- a/smmdata/info.json +++ b/smmdata/info.json @@ -13,5 +13,5 @@ "requirements": [ "beautifulsoup4" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/steamcommunity/info.json b/steamcommunity/info.json index c8a3fc38..007f5e12 100644 --- a/steamcommunity/info.json +++ b/steamcommunity/info.json @@ -13,5 +13,5 @@ "requirements": [ "python-valve" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/translators/info.json b/translators/info.json index a2e22b6f..7fcce3ea 100644 --- a/translators/info.json +++ b/translators/info.json @@ -11,5 +11,5 @@ "yandex", "translate" ], - "red_end_user_data_statement": "This cog does not persistently store data or metadata about users." + "end_user_data_statement": "This cog does not persistently store data or metadata about users." } \ No newline at end of file diff --git a/weather/info.json b/weather/info.json index 3411eba8..a18035f3 100644 --- a/weather/info.json +++ b/weather/info.json @@ -14,5 +14,5 @@ "requirements": [ "python-forecastio" ], - "red_end_user_data_statement": "This cog may store data about user's preferred measuring units.\nThis data can be remove by either via `[p]forecastunits reset` or via data removal request." + "end_user_data_statement": "This cog may store data about user's preferred measuring units.\nThis data can be remove by either via `[p]forecastunits reset` or via data removal request." } \ No newline at end of file From 155944165350ca99a8f006d375628d2246da5f60 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Sat, 22 Aug 2020 12:53:29 +0400 Subject: [PATCH 16/17] [datautils] escape formatting in roles lists --- datautils/datautils.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/datautils/datautils.py b/datautils/datautils.py index a6129835..d7f7bafb 100644 --- a/datautils/datautils.py +++ b/datautils/datautils.py @@ -84,7 +84,7 @@ async def find_app_by_name(where: list, name: str): class DataUtils(commands.Cog): """Commands for getting information about users or servers.""" - __version__ = "2.4.4" + __version__ = "2.4.5" # noinspection PyMissingConstructor def __init__(self, bot): @@ -244,7 +244,9 @@ async def uinfo(self, ctx, *, member: discord.Member = None): ) if roles := [role.name for role in member.roles if not role.is_default()]: em.add_field( - name=_("Roles"), value="\n".join(roles), inline=False, + name=_("Roles"), + value=chat.escape("\n".join(roles), formatting=True), + inline=False, ) if member.public_flags.value: em.add_field( @@ -492,7 +494,9 @@ async def cinfo( em.add_field(name=_("Users"), value=str(len(channel.members))) em.add_field( name=_("Changed roles permissions"), - value="\n".join([str(x) for x in changed_roles]) or _("Not set"), + value=chat.escape( + "\n".join([str(x) for x in changed_roles]) or _("Not set"), formatting=True + ), ) em.add_field( name=_("Mention"), value=f"{channel.mention}\n{chat.inline(channel.mention)}", @@ -726,7 +730,10 @@ async def emoji_embed(self, ctx, emoji: Union[discord.Emoji, discord.PartialEmoj em.add_field(name=_("Managed"), value=bool_emojify(emoji.managed)) em.add_field(name=_("Server"), value=emoji.guild) if emoji.roles: - em.add_field(name=_("Roles"), value="\n".join([x.name for x in emoji.roles])) + em.add_field( + name=_("Roles"), + value=chat.escape("\n".join([x.name for x in emoji.roles]), formatting=True), + ) elif isinstance(emoji, discord.PartialEmoji): em.add_field( name=_("Has existed since"), From b96ff1fe64763eae14194c26ecd84a8b10e059f8 Mon Sep 17 00:00:00 2001 From: Fixator10 Date: Tue, 25 Aug 2020 10:54:14 +0400 Subject: [PATCH 17/17] [translators] remove ytranslate thanks yandex for that --- translators/translators.py | 87 +--------------------------------- translators/yandextranslate.py | 87 ---------------------------------- 2 files changed, 2 insertions(+), 172 deletions(-) delete mode 100644 translators/yandextranslate.py diff --git a/translators/translators.py b/translators/translators.py index 9e1e9a21..dd37f161 100644 --- a/translators/translators.py +++ b/translators/translators.py @@ -10,11 +10,10 @@ import aiohttp import discord -from redbot.core import checks, commands +from redbot.core import commands from redbot.core.i18n import Translator, cog_i18n from redbot.core.utils import chat_formatting as chat -from . import yandextranslate from .converters import PySupportedEncoding _ = Translator("Translators", __file__) @@ -44,7 +43,7 @@ class Translators(commands.Cog): """Useful (and not) translators""" - __version__ = "2.1.8" + __version__ = "2.2.0" # noinspection PyMissingConstructor def __init__(self, bot): @@ -57,88 +56,6 @@ def cog_unload(self): async def red_delete_data_for_user(self, **kwargs): return - @commands.command() - @checks.is_owner() - async def ytapikey(self, ctx): - """Set API key for Yandex.Translate""" - message = _( - "To get Yandex.Translate API key:\n" - "1. Login to your Yandex account\n" - "1.1. Visit [API keys](https://translate.yandex.com/developers/keys) page\n" - "2. Press `Create a new key`\n" - "3. Enter description for key\n" - "4. Copy `trnsl.*` key\n" - "5. Use `{}set api yandex translate `" - ).format(ctx.clean_prefix) - await ctx.maybe_send_embed(message) - - @commands.command() - @commands.bot_has_permissions(embed_links=True) - async def ytranslate(self, ctx, language: str, *, text: str): - """Translate text via Yandex - - Language may be just "ru" (target language to translate) - or "en-ru" (original text's language - target language)""" - text = chat.escape(text, formatting=True) - language = language.casefold() - apikeys = await self.bot.get_shared_api_tokens("yandex") - try: - translator = yandextranslate.YTranslateAPI(self.session, apikeys.get("translate", "")) - translation = await translator.get_translation(language, text) - except yandextranslate.Exceptions.InvalidKey: - await ctx.send( - chat.error( - _( - "This command requires valid API key, check {}ytapikey to get more information" - ).format(ctx.clean_prefix) - ) - ) - except yandextranslate.Exceptions.IncorrectLang: - await ctx.send( - chat.error( - _( - "An error has been occurred: " - "Language {} is not supported or incorrect, " - "check your formatting and try again" - ).format(chat.inline(language)) - ) - ) - except yandextranslate.Exceptions.MaxTextLengthExceeded: - await ctx.send( - chat.error( - _("An error has been occurred: Text that you provided is too big to translate") - ) - ) - except yandextranslate.Exceptions.KeyBlocked: - await ctx.send( - chat.error( - _("API key is blocked. Bot owner needs to get new api key or unlock current.") - ) - ) - except yandextranslate.Exceptions.DailyLimitExceeded: - await ctx.send(chat.error(_("Daily requests limit reached. Try again later."))) - except yandextranslate.Exceptions.UnableToTranslate: - await ctx.send( - chat.error( - _( - "An error has been occurred: Yandex.Translate is unable to translate your text" - ) - ) - ) - except yandextranslate.Exceptions.UnknownException as e: - await ctx.send(chat.error(_("An error has been occurred: {}").format(e))) - else: - embed = discord.Embed( - description=f"**[{translation.lang.upper()}]**{chat.box(translation.text)}", - color=await ctx.embed_color(), - ) - embed.set_author( - name=_("Translated via Yandex.Translate"), - url="https://translate.yandex.com", - icon_url="https://translate.yandex.ru/icons/favicon.png", - ) - await ctx.send(embed=embed) - @commands.command() async def googlesay(self, ctx, lang: str, *, text: str): """Say something via Google Translate diff --git a/translators/yandextranslate.py b/translators/yandextranslate.py deleted file mode 100644 index 3945fdfb..00000000 --- a/translators/yandextranslate.py +++ /dev/null @@ -1,87 +0,0 @@ -from collections import namedtuple - -import aiohttp - - -class Exceptions: - class UnknownException(Exception): - pass - - class InvalidKey(Exception): - pass - - class KeyBlocked(Exception): - pass - - class DailyLimitExceeded(Exception): - pass - - class MaxTextLengthExceeded(Exception): - pass - - class UnableToTranslate(Exception): - pass - - class IncorrectLang(Exception): - pass - - -class YTranslateAPI: - def __init__(self, session: aiohttp.ClientSession, apikey: str): - """Creates API wrapper object - :param session: client session - :param apikey: Yandex.Translate API key""" - self.apikey = apikey - self.session = session - - async def _make_request(self, endpoint: str, **params): - """Make request to Yandex.Translate API""" - params.update({"key": self.apikey}) - async with self.session.get( - f"https://translate.yandex.net/api/v1.5/tr.json/{endpoint}", params=params - ) as response: - return await response.json() - - async def get_lang_list(self): - raise NotImplementedError - - async def detect_language(self, text: str, *, hint: list = None): - """Detect language of text - :param text: text to detect language - :param hint: list of most likely possible languages""" - response = await self._make_request("detect", text=text, hint=hint) - code = response.get("code", 0) - if code != 200: - message = response.get("message") - if code == 401: - raise Exceptions.InvalidKey(message) - if code == 402: - raise Exceptions.KeyBlocked(message) - if code == 404: - raise Exceptions.DailyLimitExceeded(message) - raise Exceptions.UnknownException(message) - return response.get("lang", "") - - async def get_translation(self, lang: str, text: str): - """Get translation for list of strings - :param lang: language in format "fr-to" or "to" - :param text: string to translate""" - response = await self._make_request("translate", text=text, lang=lang) - code = response.get("code", 0) - if code != 200: - message = response.get("message") - if code == 401: - raise Exceptions.InvalidKey(message) - if code == 402: - raise Exceptions.KeyBlocked(message) - if code == 404: - raise Exceptions.DailyLimitExceeded(message) - if code == 413: - raise Exceptions.MaxTextLengthExceeded(message) - if code == 422: - raise Exceptions.UnableToTranslate(message) - if code == 501: - raise Exceptions.IncorrectLang(message) - raise Exceptions.UnknownException(message) - Translation = namedtuple("Translation", ["lang", "text"]) - return Translation(response.get("lang", "??-??"), response.get("text", [""])[0])