Compare commits

...

4 Commits
3.1.3 ... 3.1.4

Author SHA1 Message Date
Toby Harradine
f0f274e1e1 Bump version to 3.1.4
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-16 11:26:25 +10:00
Toby Harradine
e9f014df07 Revert "Update Crowdin configuration file" (#2878)
This reverts commit 03e59ea9.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-16 10:44:49 +10:00
Toby Harradine
778eadd418 [ModLog] Fix get_case() and get_casetype() (#2877)
This fixes `[p]reason` and `[p]case` with cases that were created after 3.1.3.

Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-15 20:18:21 +10:00
Toby Harradine
3de9d15410 [CustomCom] Set Requires.ready_event before invoking CC (#2876)
Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
2019-07-15 20:13:06 +10:00
4 changed files with 16 additions and 29 deletions

View File

@@ -2,7 +2,7 @@ api_key_env: CROWDIN_API_KEY
project_identifier_env: CROWDIN_PROJECT_ID
base_path: ./redbot/
files:
- source: cogs/**/locales/messages.pot
- source: cogs/**/messages.pot
translation: /%original_path%/%locale%.po
- source: core/**/locales/messages.pot
- source: core/**/messages.pot
translation: /%original_path%/%locale%.po

View File

@@ -174,7 +174,7 @@ class VersionInfo:
)
__version__ = "3.1.3"
__version__ = "3.1.4"
version_info = VersionInfo.from_str(__version__)
# Filter fuzzywuzzy slow sequence matcher warning

View File

@@ -470,6 +470,7 @@ class CustomCommands(commands.Cog):
# wrap the command here so it won't register with the bot
fake_cc = commands.command(name=ctx.invoked_with)(self.cc_callback)
fake_cc.params = self.prepare_args(raw_response)
fake_cc.requires.ready_event.set()
ctx.command = fake_cc
await self.bot.invoke(ctx)

View File

@@ -48,24 +48,8 @@ async def _init():
_conf.register_guild(mod_log=None, casetypes={})
_conf.init_custom(_CASETYPES, 1)
_conf.init_custom(_CASES, 2)
_conf.register_custom(
_CASETYPES, default_setting=None, image=None, case_str=None, audit_type=None
)
_conf.register_custom(
_CASES,
case_number=None,
action_type=None,
guild=None,
created_at=None,
user=None,
moderator=None,
reason=None,
until=None,
channel=None,
amended_by=None,
modified_at=None,
message=None,
)
_conf.register_custom(_CASETYPES)
_conf.register_custom(_CASES)
await _migrate_config(from_version=await _conf.schema_version(), to_version=_SCHEMA_VERSION)
@@ -139,6 +123,9 @@ class Case:
The attributes to change
"""
# We don't want case_number to be changed
data.pop("case_number", None)
for item in list(data.keys()):
setattr(self, item, data[item])
@@ -267,6 +254,7 @@ class Case:
else:
user_id = self.user.id
data = {
"case_number": self.case_number,
"action_type": self.action_type,
"guild": self.guild.id,
"created_at": self.created_at,
@@ -516,7 +504,7 @@ async def get_case(case_number: int, guild: discord.Guild, bot: Red) -> Case:
"""
case = await _conf.custom(_CASES, str(guild.id), str(case_number)).all()
if not case["case_number"]:
if not case:
raise RuntimeError("That case does not exist for guild {}".format(guild.name))
mod_channel = await get_modlog_channel(guild)
return await Case.from_json(mod_channel, bot, case_number, case)
@@ -693,11 +681,9 @@ async def get_casetype(name: str, guild: Optional[discord.Guild] = None) -> Opti
-------
Optional[CaseType]
"""
try:
data = await _conf.custom(_CASETYPES, name).all()
except KeyError:
if not data:
return
else:
casetype = CaseType.from_json(name, data)
casetype.guild = guild
return casetype