mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 09:22:31 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f0f274e1e1 | ||
|
|
e9f014df07 | ||
|
|
778eadd418 | ||
|
|
3de9d15410 |
@@ -2,7 +2,7 @@ api_key_env: CROWDIN_API_KEY
|
|||||||
project_identifier_env: CROWDIN_PROJECT_ID
|
project_identifier_env: CROWDIN_PROJECT_ID
|
||||||
base_path: ./redbot/
|
base_path: ./redbot/
|
||||||
files:
|
files:
|
||||||
- source: cogs/**/locales/messages.pot
|
- source: cogs/**/messages.pot
|
||||||
translation: /%original_path%/%locale%.po
|
translation: /%original_path%/%locale%.po
|
||||||
- source: core/**/locales/messages.pot
|
- source: core/**/messages.pot
|
||||||
translation: /%original_path%/%locale%.po
|
translation: /%original_path%/%locale%.po
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ class VersionInfo:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
__version__ = "3.1.3"
|
__version__ = "3.1.4"
|
||||||
version_info = VersionInfo.from_str(__version__)
|
version_info = VersionInfo.from_str(__version__)
|
||||||
|
|
||||||
# Filter fuzzywuzzy slow sequence matcher warning
|
# Filter fuzzywuzzy slow sequence matcher warning
|
||||||
|
|||||||
@@ -470,6 +470,7 @@ class CustomCommands(commands.Cog):
|
|||||||
# wrap the command here so it won't register with the bot
|
# 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 = commands.command(name=ctx.invoked_with)(self.cc_callback)
|
||||||
fake_cc.params = self.prepare_args(raw_response)
|
fake_cc.params = self.prepare_args(raw_response)
|
||||||
|
fake_cc.requires.ready_event.set()
|
||||||
ctx.command = fake_cc
|
ctx.command = fake_cc
|
||||||
|
|
||||||
await self.bot.invoke(ctx)
|
await self.bot.invoke(ctx)
|
||||||
|
|||||||
@@ -48,24 +48,8 @@ async def _init():
|
|||||||
_conf.register_guild(mod_log=None, casetypes={})
|
_conf.register_guild(mod_log=None, casetypes={})
|
||||||
_conf.init_custom(_CASETYPES, 1)
|
_conf.init_custom(_CASETYPES, 1)
|
||||||
_conf.init_custom(_CASES, 2)
|
_conf.init_custom(_CASES, 2)
|
||||||
_conf.register_custom(
|
_conf.register_custom(_CASETYPES)
|
||||||
_CASETYPES, default_setting=None, image=None, case_str=None, audit_type=None
|
_conf.register_custom(_CASES)
|
||||||
)
|
|
||||||
_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,
|
|
||||||
)
|
|
||||||
await _migrate_config(from_version=await _conf.schema_version(), to_version=_SCHEMA_VERSION)
|
await _migrate_config(from_version=await _conf.schema_version(), to_version=_SCHEMA_VERSION)
|
||||||
|
|
||||||
|
|
||||||
@@ -139,6 +123,9 @@ class Case:
|
|||||||
The attributes to change
|
The attributes to change
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
# We don't want case_number to be changed
|
||||||
|
data.pop("case_number", None)
|
||||||
|
|
||||||
for item in list(data.keys()):
|
for item in list(data.keys()):
|
||||||
setattr(self, item, data[item])
|
setattr(self, item, data[item])
|
||||||
|
|
||||||
@@ -267,6 +254,7 @@ class Case:
|
|||||||
else:
|
else:
|
||||||
user_id = self.user.id
|
user_id = self.user.id
|
||||||
data = {
|
data = {
|
||||||
|
"case_number": self.case_number,
|
||||||
"action_type": self.action_type,
|
"action_type": self.action_type,
|
||||||
"guild": self.guild.id,
|
"guild": self.guild.id,
|
||||||
"created_at": self.created_at,
|
"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()
|
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))
|
raise RuntimeError("That case does not exist for guild {}".format(guild.name))
|
||||||
mod_channel = await get_modlog_channel(guild)
|
mod_channel = await get_modlog_channel(guild)
|
||||||
return await Case.from_json(mod_channel, bot, case_number, case)
|
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]
|
Optional[CaseType]
|
||||||
"""
|
"""
|
||||||
try:
|
|
||||||
data = await _conf.custom(_CASETYPES, name).all()
|
data = await _conf.custom(_CASETYPES, name).all()
|
||||||
except KeyError:
|
if not data:
|
||||||
return
|
return
|
||||||
else:
|
|
||||||
casetype = CaseType.from_json(name, data)
|
casetype = CaseType.from_json(name, data)
|
||||||
casetype.guild = guild
|
casetype.guild = guild
|
||||||
return casetype
|
return casetype
|
||||||
|
|||||||
Reference in New Issue
Block a user