From dcdb0a65ea2696f6883672dc12f68c015067a366 Mon Sep 17 00:00:00 2001 From: ziro Date: Wed, 15 Mar 2023 10:22:10 +0700 Subject: [PATCH 01/26] feat: Better typehint support Inspired by Android's requireActivity() --- src/main/core/context.py | 15 ++++++++++++++- src/main/exts/meta/meta.py | 8 ++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/main/core/context.py b/src/main/core/context.py index a3e60155..62531ed0 100644 --- a/src/main/core/context.py +++ b/src/main/core/context.py @@ -4,6 +4,8 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. """ +from __future__ import annotations + import io from contextlib import asynccontextmanager from typing import Union @@ -119,8 +121,19 @@ def replied_reference(self): return None @discord.utils.cached_property - def guild(self): + def guild(self) -> GuildWrapper | None: g = self.message.guild if g: return GuildWrapper(g, self.bot) return None + + def requireGuild(self) -> GuildWrapper: + """ + Inspired by Android's requireActivity() + + Should only be used if the command has guild only check + """ + g = self.guild + if not g: + raise commands.NoPrivateMessage + return g diff --git a/src/main/exts/meta/meta.py b/src/main/exts/meta/meta.py index 9645845e..625f62e1 100644 --- a/src/main/exts/meta/meta.py +++ b/src/main/exts/meta/meta.py @@ -165,10 +165,10 @@ async def prefAdd(self, ctx, *prefix: str): return await ctx.error("Prefix can't be empty!") try: - await ctx.guild.addPrefix(_prefix) + await ctx.requireGuild().addPrefix(_prefix) await ctx.success(title="Prefix `{}` has been added".format(cleanifyPrefix(self.bot, _prefix))) except Exception as exc: - await ctx.error(exc) + await ctx.error(str(exc)) @prefix.command( name="remove", @@ -189,10 +189,10 @@ async def prefRm(self, ctx: Context, *, prefix: str): return await ctx.error("Prefix can't be empty!") try: - await ctx.guild.rmPrefix(_prefix.lstrip()) + await ctx.requireGuild().rmPrefix(_prefix.lstrip()) await ctx.success(title="Prefix `{}` has been removed".format(cleanifyPrefix(self.bot, _prefix))) except Exception as exc: - await ctx.error(exc) + await ctx.error(str(exc)) @commands.hybrid_command(aliases=("p",), brief="Get bot's response time") async def ping(self, ctx): From 6a8d84d41d369fed2696c0b11844fecf23d9aa2d Mon Sep 17 00:00:00 2001 From: ziro Date: Wed, 15 Mar 2023 10:25:03 +0700 Subject: [PATCH 02/26] fix: Sometime the bot think a prefix is already removed --- src/main/exts/meta/meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/exts/meta/meta.py b/src/main/exts/meta/meta.py index 625f62e1..54a7f65f 100644 --- a/src/main/exts/meta/meta.py +++ b/src/main/exts/meta/meta.py @@ -183,7 +183,7 @@ async def prefAdd(self, ctx, *prefix: str): ), ) @checks.is_mod() - async def prefRm(self, ctx: Context, *, prefix: str): + async def prefRm(self, ctx: Context, *prefix: str): _prefix = " ".join(prefix).lstrip() if not _prefix: return await ctx.error("Prefix can't be empty!") From ce8eb49963da14a564b40bb1d1af2cc8ec089ab5 Mon Sep 17 00:00:00 2001 From: ziro Date: Wed, 15 Mar 2023 12:20:05 +0700 Subject: [PATCH 03/26] refactor: Merge infoQuote to format --- src/main/exts/info/info.py | 1 - src/main/exts/meta/_help.py | 8 ++++---- src/main/exts/meta/_pages.py | 5 ++--- src/main/utils/format.py | 19 +++++++++++++++++++ src/main/utils/infoQuote.py | 24 ------------------------ 5 files changed, 25 insertions(+), 32 deletions(-) delete mode 100644 src/main/utils/infoQuote.py diff --git a/src/main/exts/info/info.py b/src/main/exts/info/info.py index 7e1614bc..b031c96a 100644 --- a/src/main/exts/info/info.py +++ b/src/main/exts/info/info.py @@ -21,7 +21,6 @@ from ...utils import pillow from ...utils.api.openweather import CityNotFound, OpenWeatherAPI from ...utils.format import formatDiscordDT, renderBar -from ...utils.infoQuote import * # noqa: F403 from ...utils.other import authorOrReferenced, utcnow diff --git a/src/main/exts/meta/_help.py b/src/main/exts/meta/_help.py index d1dd1077..095da7a7 100644 --- a/src/main/exts/meta/_help.py +++ b/src/main/exts/meta/_help.py @@ -14,8 +14,7 @@ from ...core.embed import ZEmbed from ...core.menus import ZChoices, ZMenuPagesView, choice -from ...utils import infoQuote -from ...utils.format import formatDiscordDT +from ...utils.format import formatDiscordDT, info from ._custom_command import CustomCommand from ._errors import CCommandNotFound from ._flags import HelpFlags @@ -35,7 +34,7 @@ async def send_bot_help(self, mapping) -> discord.Message: ctx = self.context e = ZEmbed( - description=infoQuote.info( + description=info( ( "`( )` = Required Argument\n" "`[ ]` = Optional Argument\n" @@ -155,6 +154,7 @@ async def prepare_help_command(self, ctx, arguments) -> tuple: filterAliases = { "c": "custom", "b": "built-in", + "builtin": "built-in", } # get unique value from filters (also get "real value" if its an alias) @@ -173,7 +173,7 @@ async def send_custom_help(self) -> None: # TODO: Improve the output ctx = self.context - if not (guild := ctx.guild): + if not ctx.guild: return cmds = await CustomCommand.getAll(ctx) diff --git a/src/main/exts/meta/_pages.py b/src/main/exts/meta/_pages.py index 81ec4f9c..eada95cc 100644 --- a/src/main/exts/meta/_pages.py +++ b/src/main/exts/meta/_pages.py @@ -10,8 +10,7 @@ from ...core.embed import ZEmbed from ...core.menus import ZMenuView -from ...utils import infoQuote -from ...utils.format import cleanifyPrefix, formatCmd +from ...utils.format import cleanifyPrefix, formatCmd, info from ._custom_command import CustomCommand from ._utils import getDisabledCommands from ._wrapper import GroupSplitWrapper @@ -65,7 +64,7 @@ async def format_page(self, menu: ZMenuView, _commands): elif not ctx.guild: self.disabled = [] - desc = infoQuote.info( + desc = info( "` ᶜ ` = Custom Command\n" "` ᵍ ` = Group (have subcommand(s))\n" "` ˢ ` = Slash (integrated to Discord's `/` command handler)\n" diff --git a/src/main/utils/format.py b/src/main/utils/format.py index 72d80e48..f3dc4e66 100644 --- a/src/main/utils/format.py +++ b/src/main/utils/format.py @@ -198,3 +198,22 @@ def formatTraceback(text: str, error: Exception, *, _print: bool = False) -> str trace = error.__traceback__ lines = traceback.format_exception(etype, error, trace) return "".join(lines) + + +def info( + message: str, + *, + title: str = "Information", + emoji: str = "<:info:783206485051441192>", + indent: int = 4, + codeBlock: bool = False, +): + messages = message.split("\n") + message = "" if not codeBlock else "> ```diff\n" + for msg in messages: + if not codeBlock: + message += ">{}{}\n".format(" " * indent if indent else "", msg) + else: + message += "> {}\n".format(msg) + message += "" if not codeBlock else "> ```" + return "> {} **`{}`** \n{}".format(emoji, title, message) diff --git a/src/main/utils/infoQuote.py b/src/main/utils/infoQuote.py deleted file mode 100644 index 7b5194f8..00000000 --- a/src/main/utils/infoQuote.py +++ /dev/null @@ -1,24 +0,0 @@ -""" -This Source Code Form is subject to the terms of the Mozilla Public -License, v. 2.0. If a copy of the MPL was not distributed with this -file, You can obtain one at http://mozilla.org/MPL/2.0/. -""" - - -def info( - message: str, - *, - title: str = "Information", - emoji: str = "<:info:783206485051441192>", - indent: int = 4, - codeBlock: bool = False -): - messages = message.split("\n") - message = "" if not codeBlock else "> ```diff\n" - for msg in messages: - if not codeBlock: - message += ">{}{}\n".format(" " * indent if indent else "", msg) - else: - message += "> {}\n".format(msg) - message += "" if not codeBlock else "> ```" - return "> {} **`{}`** \n{}".format(emoji, title, message) From e31b5d0cf136bdc4ac2b0fed8038af3e37893532 Mon Sep 17 00:00:00 2001 From: ziro Date: Wed, 15 Mar 2023 12:27:01 +0700 Subject: [PATCH 04/26] docs: Default branch changed to `dev` for easier developement [skip ci] --- .github/README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/README.md b/.github/README.md index c4a0aa67..d8c1864c 100644 --- a/.github/README.md +++ b/.github/README.md @@ -19,6 +19,10 @@ ## About +> **Info** +> +> `dev` branch is used mostly for development and generally considered as unstable, to host the bot it's recommended to use `overhaul` branch instead! + **`Z3R0`** (codename **`ziBot`**) is a **free** and **open-source** multi-purpose discord bot, created for fun in the middle of quarantine. Used to be fork of [Steve-Bot](https://github.com/MCBE-Speedrunning/Steve-Bot) by MCBE Speedrunning Moderators. ### Features @@ -104,7 +108,7 @@ More feature coming soon! > Python 3.10+ (3.10.9 is recommended) is required to host this bot! - Download this repository by executing `git clone https://github.com/ZiRO-Bot/Z3R0.git` - or click "Code" -> "Download ZIP" + or click "Code" -> "Download ZIP" (be sure to choose `overhaul` branch first!) - Install poetry by executing this command, ```zsh From fb1201d511e3ca200e468c762445c6ea2b2b4cc0 Mon Sep 17 00:00:00 2001 From: ziro Date: Wed, 15 Mar 2023 13:30:03 +0700 Subject: [PATCH 05/26] refactor(exts/meta): Improve custom command code * ccModeCheck is now an actual check (hasCCPriviledge) * CustomCommand class is now a converter --- .github/CHANGELOG.md | 2 + src/main/exts/meta/_checks.py | 31 +++++++ src/main/exts/meta/_custom_command.py | 25 ++++- .../meta/subcogs/meta__custom_commands.py | 92 +++++-------------- 4 files changed, 78 insertions(+), 72 deletions(-) create mode 100644 src/main/exts/meta/_checks.py diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index bcbee3c1..2644b49e 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -36,6 +36,8 @@ - [**Improved**] Moved JSON (and Blacklist) and Cache (and its properties) into `core.data` - [**Changed**] Removed `CMDName` - [**Added**] Initial ZeroMQ support for Dashboard +- [**Improved**] `ccModeCheck` is now an actual check (`hasCCPriviledge`) +- [**Improved**] CustomCommand is now a converter # v3.5 (Overhaul an Overhaul?) diff --git a/src/main/exts/meta/_checks.py b/src/main/exts/meta/_checks.py new file mode 100644 index 00000000..3a318abd --- /dev/null +++ b/src/main/exts/meta/_checks.py @@ -0,0 +1,31 @@ +""" +This Source Code Form is subject to the terms of the Mozilla Public +License, v. 2.0. If a copy of the MPL was not distributed with this +file, You can obtain one at http://mozilla.org/MPL/2.0/. +""" + +from __future__ import annotations + +from discord.ext import commands + +from ...core import checks +from ...core.context import Context +from ...core.guild import CCMode +from ._custom_command import checks +from ._errors import CCommandNoPerm + + +def hasCCPriviledge(): + async def predicate(ctx: Context): + """Check for custom command's modes.""" + # 0: Only mods, + # 1: Partial (Can add but only able to manage their own command), + # 2: Full (Anarchy mode) + mode = await ctx.requireGuild().getCCMode() + isMod = await checks.isMod(ctx) + hasPriviledge = isMod if mode == CCMode.MOD_ONLY else True + if not hasPriviledge: + raise CCommandNoPerm + return hasPriviledge + + return commands.check(predicate) diff --git a/src/main/exts/meta/_custom_command.py b/src/main/exts/meta/_custom_command.py index f4ed772e..a7a6ea1b 100644 --- a/src/main/exts/meta/_custom_command.py +++ b/src/main/exts/meta/_custom_command.py @@ -6,9 +6,8 @@ from __future__ import annotations -from enum import Enum - import discord +from discord.ext import commands import tse @@ -16,7 +15,12 @@ from ...core.context import Context from ...core.guild import GuildWrapper from ...utils.other import reactsToMessage, utcnow -from ._errors import CCommandDisabled, CCommandNotFound, CCommandNotInGuild +from ._errors import ( + CCommandDisabled, + CCommandNoPerm, + CCommandNotFound, + CCommandNotInGuild, +) _blocks = [ @@ -33,7 +37,7 @@ ENGINE = tse.Interpreter(_blocks) -class CustomCommand: +class CustomCommand(commands.Converter): """Object for custom command.""" __slots__ = ( @@ -245,3 +249,16 @@ async def getAll(context: Context | discord.Object, category: str = None) -> lis cmds[cmd.id]["aliases"] = [lookup.name] return [CustomCommand(id=k, **v) for k, v in cmds.items()] + + @classmethod + async def convert(cls, ctx: Context, name: str) -> CustomCommand: + return await cls.get(ctx, name) + + +class ManagedCustomCommand(CustomCommand): + @classmethod + async def convert(cls, ctx: Context, name: str) -> CustomCommand: + command = await super().convert(ctx, name) + if not await command.canManage(ctx): + raise CCommandNoPerm + return command diff --git a/src/main/exts/meta/subcogs/meta__custom_commands.py b/src/main/exts/meta/subcogs/meta__custom_commands.py index 7a2dad5e..723c46b0 100644 --- a/src/main/exts/meta/subcogs/meta__custom_commands.py +++ b/src/main/exts/meta/subcogs/meta__custom_commands.py @@ -22,7 +22,8 @@ from ....core.mixin import CogMixin from ....utils.format import formatCmdName from ....utils.other import utcnow -from .._custom_command import CustomCommand +from .._checks import hasCCPriviledge +from .._custom_command import CustomCommand, ManagedCustomCommand from .._errors import CCommandAlreadyExists, CCommandNoPerm, CCommandNotFound from .._flags import CmdManagerFlags from .._utils import getDisabledCommands @@ -53,15 +54,6 @@ def __init__(self, bot: ziBot): unique=True, ) - async def ccModeCheck(self, ctx): - """Check for custom command's modes.""" - # 0: Only mods, - # 1: Partial (Can add but only able to manage their own command), - # 2: Full (Anarchy mode) - mode = await ctx.guild.getCCMode() - isMod = await checks.isMod(ctx) - return isMod if mode == CCMode.MOD_ONLY else True - # TODO: Separate tags from custom command @commands.group( aliases=("cmd", "tag", "script"), @@ -73,9 +65,10 @@ async def command(self, _): pass @command.command(aliases=("exec", "execute"), brief="Execute a custom command") - async def run(self, ctx, name: str, argument: str = ""): - cmd = await CustomCommand.get(ctx, name) - return await cmd.execute(ctx, argument) + async def run(self, ctx, command: CustomCommand | str, argument: str = ""): + if isinstance(command, str): + command = await CustomCommand.get(ctx, command) + return await command.execute(ctx, argument) @command.command( name="source", @@ -83,9 +76,8 @@ async def run(self, ctx, name: str, argument: str = ""): brief="Get raw content of a custom command", ) @commands.cooldown(1, 5, commands.BucketType.user) - async def _source(self, ctx, name: str): - cmd = await CustomCommand.get(ctx, name) - return await cmd.execute(ctx, raw=True) + async def _source(self, ctx, command: CustomCommand): + return await command.execute(ctx, raw=True) async def addCmd(self, ctx, name: str, content: str, **kwargs): """Add cmd to database""" @@ -146,11 +138,8 @@ async def isCmdExist(self, ctx, name: str): }, ), ) + @hasCCPriviledge() async def _import(self, ctx: Context, name: str, *, url: str): - perm = await self.ccModeCheck(ctx) - if not perm: - raise CCommandNoPerm - # NOTE: This command will only support pastebin and gist.github, # maybe also hastebin. try: @@ -192,11 +181,8 @@ async def _import(self, ctx: Context, name: str, *, url: str): }, ), ) + @hasCCPriviledge() async def _add(self, ctx, name: str, *, content: str): - perm = await self.ccModeCheck(ctx) - if not perm: - raise CCommandNoPerm - # Check if command already exists await self.isCmdExist(ctx, name) @@ -244,7 +230,7 @@ async def update_url(self, ctx: Context, name: str, url: str): title="`{}` url has been set to <{}>".format(name, url), ) - async def updateCommandContent(self, _: Context, command: CustomCommand, content): + async def updateCommandContent(self, _: Context, command: ManagedCustomCommand, content): """Update command's content""" update = await db.Commands.filter(id=command.id).update(content=content) if update: @@ -260,22 +246,16 @@ async def updateCommandContent(self, _: Context, command: CustomCommand, content }, ), ) - async def update(self, ctx: Context, name: str): + async def update(self, ctx: Context, command: ManagedCustomCommand): # NOTE: Can only be run by cmd owner or guild mods/owner # For both checking if command exists and # getting its content for comparation later on - command = await CustomCommand.get(ctx, name) - - perm = await command.canManage(ctx) - if not perm: - raise CCommandNoPerm - if not command.url: # Incase someone try to update `text` command return await ctx.error( "Please use `{}command edit` instead!".format(ctx.clean_prefix), - title="`{}` is not imported command!".format(name), + title="`{}` is not imported command!".format(command.name), ) content = None @@ -301,7 +281,7 @@ async def update(self, ctx: Context, name: str): if update: return await ctx.success( ("`[+]` {} Additions\n".format(addition) + "`[-]` {} Deletions".format(deletion)), - title="Command `{}` has been update\n".format(name), + title="Command `{}` has been update\n".format(command.name), ) @command.command( @@ -318,13 +298,7 @@ async def update(self, ctx: Context, name: str): }, ), ) - async def alias(self, ctx, commandName: str, alias: str): - command = await CustomCommand.get(ctx, commandName) - - perm = await command.canManage(ctx) - if not perm: - raise CCommandNoPerm - + async def alias(self, ctx, command: ManagedCustomCommand, alias: str): if alias == command.name: return await ctx.error("Alias can't be identical to original name!") if alias in command.aliases: @@ -345,7 +319,7 @@ async def alias(self, ctx, commandName: str, alias: str): }, ), ) - async def cmdEdit(self, ctx, command: str, *, content): + async def cmdEdit(self, ctx, command: ManagedCustomCommand, *, content): await self.setContent(ctx, command, content=content) @command.group( @@ -377,16 +351,10 @@ async def cmdSet(self, _): }, ), ) - async def setContent(self, ctx, name: str, *, content): - command = await CustomCommand.get(ctx, name) - - perm = await command.canManage(ctx) - if not perm: - raise CCommandNoPerm - + async def setContent(self, ctx, command: ManagedCustomCommand, *, content): update = await self.updateCommandContent(ctx, command, content) if update: - return await ctx.success(title="Command `{}` has been edited\n".format(name)) + return await ctx.success(title="Command `{}` has been edited\n".format(command)) @cmdSet.command( name="url", @@ -400,7 +368,7 @@ async def setUrl(self, ctx, name: str, url: str): name="alias", brief="Alias for `command alias`", ) - async def setAlias(self, ctx, command: str, alias: str): + async def setAlias(self, ctx, command: ManagedCustomCommand, alias: str): await self.alias(ctx, command, alias) @cmdSet.command( @@ -414,19 +382,13 @@ async def setAlias(self, ctx, command: str, alias: str): }, ), ) - async def setCategory(self, ctx, _command: str, category: str): + async def setCategory(self, ctx, command: ManagedCustomCommand, category: str): category = category.lower() availableCats = [cog.qualified_name.lower() for cog in ctx.bot.cogs.values() if getattr(cog, "cc", False)] if category not in availableCats: return await ctx.error(title="Invalid category") - command = await CustomCommand.get(ctx, _command) - - perm = await command.canManage(ctx) - if not perm: - raise CCommandNoPerm - if command.category == category: return await ctx.success(title="{} already in {}!".format(command, category)) @@ -477,21 +439,15 @@ async def setMode(self, ctx, mode: int): }, ), ) - async def remove(self, ctx, name: str): - command = await CustomCommand.get(ctx, name) - - perm = await command.canManage(ctx) - if not perm: - raise CCommandNoPerm - - isAlias = name in command.aliases + async def remove(self, ctx, command: ManagedCustomCommand): + isAlias = command.invokedName in command.aliases if isAlias: - await db.CommandsLookup.filter(name=name, guild_id=ctx.guild.id).delete() + await db.CommandsLookup.filter(name=command.invokedName, guild_id=ctx.guild.id).delete() else: # NOTE: Aliases will be deleted automatically await db.Commands.filter(id=command.id).delete() - return await ctx.success(title="{} `{}` has been removed".format("Alias" if isAlias else "Command", name)) + return await ctx.success(title="{} `{}` has been removed".format("Alias" if isAlias else "Command", command.name)) async def disableEnableHelper( self, From 715de0978da1f84cd248f9ae0507551b1a31c7fb Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 09:09:04 +0700 Subject: [PATCH 06/26] chore: Deprecate snake_case functions --- src/main/core/context.py | 16 ++++++++++------ src/main/exts/fun/fun.py | 10 ++++++++-- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/main/core/context.py b/src/main/core/context.py index 62531ed0..9335e0a5 100644 --- a/src/main/core/context.py +++ b/src/main/core/context.py @@ -26,10 +26,6 @@ def __init__(self, **kwargs) -> None: def session(self) -> aiohttp.ClientSession: return self.bot.session - # @property - # def db(self): - # return self.bot.db - @property def cache(self): return self.bot.cache @@ -64,12 +60,20 @@ async def safe_send_reply(self, content, *, escape_mentions=True, type="send", * kwargs["content"] = content return await action(**kwargs) - async def safe_send(self, content, *, escape_mentions=True, **kwargs): + async def safe_send(self, content, *, escape_mentions: bool = True, **kwargs): + # TODO: Deprecate return await self.safe_send_reply(content, escape_mentions=escape_mentions, type="send", **kwargs) - async def safe_reply(self, content, *, escape_mentions=True, **kwargs): + async def safeSend(self, content, *, escapeMentions: bool = True, **kwargs): + return await self.safe_send(content, escape_mentions=escapeMentions, **kwargs) + + async def safe_reply(self, content, *, escape_mentions: bool = True, **kwargs): + # TODO: Deprecate return await self.safe_send_reply(content, escape_mentions=escape_mentions, type="reply", **kwargs) + async def safeReply(self, content, *, escapeMentions: bool = True, **kwargs): + return await self.safe_reply(content, escape_mentions=escapeMentions, **kwargs) + async def error(self, error_message: str = None, title: str = "Something went wrong!"): e = ZEmbed.error(title="ERROR" + (f": {title}" if title else "")) if error_message is not None: diff --git a/src/main/exts/fun/fun.py b/src/main/exts/fun/fun.py index 2c3a4bac..7c248c8e 100644 --- a/src/main/exts/fun/fun.py +++ b/src/main/exts/fun/fun.py @@ -185,9 +185,15 @@ async def findseed(self, ctx, *, args: FindseedFlags = None): "Ping random member\n" 'Also known as "Discord\'s mistake"\n' "**Note**: Only available on April Fools (UTC)!" ), ) + @commands.cooldown(1, 5, commands.BucketType.user) + @commands.guild_only() @checks.isAprilFool() - async def someone(self, ctx): - await ctx.send(choice(ctx.guild.members).mention) + async def someone(self, ctx: Context): + allowPingGuilds = (793642143243173888,) + allowedMentions = discord.AllowedMentions.none() + if ctx.requireGuild().id in allowPingGuilds: + allowedMentions = discord.AllowedMentions(users=True) + await ctx.send(choice(ctx.requireGuild().members).mention, allowed_mentions=allowedMentions) @commands.hybrid_command( usage="(status code)", From ab3eafb4a6206227f3679440181b3344e260b193 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 12:24:09 +0700 Subject: [PATCH 07/26] fix: Typo [skip ci] --- src/main/exts/fun/fun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/exts/fun/fun.py b/src/main/exts/fun/fun.py index 7c248c8e..e387c6f5 100644 --- a/src/main/exts/fun/fun.py +++ b/src/main/exts/fun/fun.py @@ -323,7 +323,7 @@ async def flip(self, ctx): "**Support optional size**: d4, d8, d10, d00, d12, d20" ), usage="[dice size] (number of dice)", - extras=dict(example=("roll 5", "roll d20", "role d00 4")), + extras=dict(example=("roll 5", "roll d20", "roll d00 4")), ) @commands.cooldown(1, 5, type=commands.BucketType.user) async def roll(self, ctx, *args): From d7b7e7c75b4395c39765ebccf9bec3b045670f9a Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 13:17:53 +0700 Subject: [PATCH 08/26] fix: Aerich 0.7.x --- aerich.ini | 4 - aerichConfig.py | 1 + poetry.lock | 310 +++++++++--------- pyproject.toml | 6 +- .../models/0_20211009115827_init.sql | 87 ----- 5 files changed, 159 insertions(+), 249 deletions(-) delete mode 100644 aerich.ini delete mode 100644 src/main/migrations/models/0_20211009115827_init.sql diff --git a/aerich.ini b/aerich.ini deleted file mode 100644 index c46c9419..00000000 --- a/aerich.ini +++ /dev/null @@ -1,4 +0,0 @@ -[aerich] -tortoise_orm = aerichConfig.cfg.tortoiseConfig -location = ./migrations -src_folder = ./. diff --git a/aerichConfig.py b/aerichConfig.py index e0d86257..f9e4c44f 100644 --- a/aerichConfig.py +++ b/aerichConfig.py @@ -11,3 +11,4 @@ dbUrl = os.environ["ZIBOT_DB_URL"] cfg = Config("", dbUrl) +t = cfg.tortoiseConfig diff --git a/poetry.lock b/poetry.lock index 0511155e..8db29354 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,14 +2,14 @@ [[package]] name = "aerich" -version = "0.6.3" +version = "0.7.1" description = "A database migrations tool for Tortoise ORM." category = "dev" optional = false python-versions = ">=3.7,<4.0" files = [ - {file = "aerich-0.6.3-py3-none-any.whl", hash = "sha256:d45f98214ed54b8ec9be949df264c5b0b9e8b79d8f8ba9e68714675bc81a5574"}, - {file = "aerich-0.6.3.tar.gz", hash = "sha256:96ac087922048470687264125cb9dfeaade982219c78e6a9b91a0fb67eaa1cd1"}, + {file = "aerich-0.7.1-py3-none-any.whl", hash = "sha256:ca1c46e777c448c8344961bb591ee8cc7bfcb2fc7527bea4da43647b5fbf8fbe"}, + {file = "aerich-0.7.1.tar.gz", hash = "sha256:501f6598ae51e3ce19b1bfc21ff365f582e7447e6aa5215629451c40341d6eb8"}, ] [package.dependencies] @@ -614,14 +614,14 @@ files = [ [[package]] name = "dpytest" -version = "0.6.1" +version = "0.6.3" description = "A package that assists in writing tests for discord.py" category = "dev" optional = false python-versions = "*" files = [ - {file = "dpytest-0.6.1-py3-none-any.whl", hash = "sha256:31cab284a61880ffd0cf5bfb067038e7a5598f05c4475a075c2586c7e915b4f9"}, - {file = "dpytest-0.6.1.tar.gz", hash = "sha256:755e770cee0cc276dbb3bb5bf6a60f7bd6a706b93b1143420007901012b3359a"}, + {file = "dpytest-0.6.3-py3-none-any.whl", hash = "sha256:e4a395b1ed3ff1e5afa02cfcfb6f77005cb319eced7a130d08e68b6655af721e"}, + {file = "dpytest-0.6.3.tar.gz", hash = "sha256:8dc673a6eaf409ca6c00c80dccbc0f23d86cfd6f41ab34b4040ba4ff3fb2a582"}, ] [package.dependencies] @@ -630,14 +630,14 @@ pytest-asyncio = "*" [[package]] name = "exceptiongroup" -version = "1.1.0" +version = "1.1.1" description = "Backport of PEP 654 (exception groups)" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.0-py3-none-any.whl", hash = "sha256:327cbda3da756e2de031a3107b81ab7b3770a602c4d16ca618298c526f4bec1e"}, - {file = "exceptiongroup-1.1.0.tar.gz", hash = "sha256:bcb67d800a4497e1b404c2dd44fca47d3b7a5e5433dbab67f96c1a685cdfdf23"}, + {file = "exceptiongroup-1.1.1-py3-none-any.whl", hash = "sha256:232c37c63e4f682982c8b6459f33a8981039e5fb8756b2074364e5055c498c9e"}, + {file = "exceptiongroup-1.1.1.tar.gz", hash = "sha256:d484c3090ba2889ae2928419117447a14daf3c1231d5e30d0aae34f354f01785"}, ] [package.extras] @@ -645,19 +645,19 @@ test = ["pytest (>=6)"] [[package]] name = "filelock" -version = "3.9.0" +version = "3.10.0" description = "A platform independent file lock." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "filelock-3.9.0-py3-none-any.whl", hash = "sha256:f58d535af89bb9ad5cd4df046f741f8553a418c01a7856bf0d173bbc9f6bd16d"}, - {file = "filelock-3.9.0.tar.gz", hash = "sha256:7b319f24340b51f55a2bf7a12ac0755a9b03e718311dac567a0f4f7fabd2f5de"}, + {file = "filelock-3.10.0-py3-none-any.whl", hash = "sha256:e90b34656470756edf8b19656785c5fea73afa1953f3e1b0d645cef11cab3182"}, + {file = "filelock-3.10.0.tar.gz", hash = "sha256:3199fd0d3faea8b911be52b663dfccceb84c95949dd13179aa21436d1a79c4ce"}, ] [package.extras] -docs = ["furo (>=2022.12.7)", "sphinx (>=5.3)", "sphinx-autodoc-typehints (>=1.19.5)"] -testing = ["covdefaults (>=2.2.2)", "coverage (>=7.0.1)", "pytest (>=7.2)", "pytest-cov (>=4)", "pytest-timeout (>=2.1)"] +docs = ["furo (>=2022.12.7)", "sphinx (>=6.1.3)", "sphinx-autodoc-typehints (>=1.22,!=1.23.4)"] +testing = ["covdefaults (>=2.3)", "coverage (>=7.2.1)", "pytest (>=7.2.2)", "pytest-cov (>=4)", "pytest-timeout (>=2.1)"] [[package]] name = "flake8" @@ -792,14 +792,14 @@ tests = ["freezegun", "pytest", "pytest-cov"] [[package]] name = "identify" -version = "2.5.18" +version = "2.5.20" description = "File identification library for Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "identify-2.5.18-py2.py3-none-any.whl", hash = "sha256:93aac7ecf2f6abf879b8f29a8002d3c6de7086b8c28d88e1ad15045a15ab63f9"}, - {file = "identify-2.5.18.tar.gz", hash = "sha256:89e144fa560cc4cffb6ef2ab5e9fb18ed9f9b3cb054384bab4b95c12f6c309fe"}, + {file = "identify-2.5.20-py2.py3-none-any.whl", hash = "sha256:5dfef8a745ca4f2c95f27e9db74cb4c8b6d9916383988e8791f3595868f78a33"}, + {file = "identify-2.5.20.tar.gz", hash = "sha256:c8b288552bc5f05a08aff09af2f58e6976bf8ac87beb38498a0e3d98ba64eb18"}, ] [package.extras] @@ -1208,14 +1208,14 @@ files = [ [[package]] name = "pathspec" -version = "0.11.0" +version = "0.11.1" description = "Utility library for gitignore style pattern matching of file paths." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pathspec-0.11.0-py3-none-any.whl", hash = "sha256:3a66eb970cbac598f9e5ccb5b2cf58930cd8e3ed86d393d541eaf2d8b1705229"}, - {file = "pathspec-0.11.0.tar.gz", hash = "sha256:64d338d4e0914e91c1792321e6907b5a593f1ab1851de7fc269557a21b30ebbc"}, + {file = "pathspec-0.11.1-py3-none-any.whl", hash = "sha256:d8af70af76652554bd134c22b3e8a1cc46ed7d91edcdd721ef1a0c51a84a5293"}, + {file = "pathspec-0.11.1.tar.gz", hash = "sha256:2798de800fa92780e33acca925945e9a19a133b715067cf165b8866c15a31687"}, ] [[package]] @@ -1295,14 +1295,14 @@ tests = ["check-manifest", "coverage", "defusedxml", "markdown2", "olefile", "pa [[package]] name = "platformdirs" -version = "3.0.0" +version = "3.1.1" description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "platformdirs-3.0.0-py3-none-any.whl", hash = "sha256:b1d5eb14f221506f50d6604a561f4c5786d9e80355219694a1b244bcd96f4567"}, - {file = "platformdirs-3.0.0.tar.gz", hash = "sha256:8a1228abb1ef82d788f74139988b137e78692984ec7b08eaa6c65f1723af28f9"}, + {file = "platformdirs-3.1.1-py3-none-any.whl", hash = "sha256:e5986afb596e4bb5bde29a79ac9061aa955b94fca2399b7aaac4090860920dd8"}, + {file = "platformdirs-3.1.1.tar.gz", hash = "sha256:024996549ee88ec1a9aa99ff7f8fc819bb59e2c3477b410d90a16d32d6e707aa"}, ] [package.extras] @@ -1370,48 +1370,48 @@ files = [ [[package]] name = "pydantic" -version = "1.10.5" +version = "1.10.6" description = "Data validation and settings management using python type hints" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pydantic-1.10.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5920824fe1e21cbb3e38cf0f3dd24857c8959801d1031ce1fac1d50857a03bfb"}, - {file = "pydantic-1.10.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:3bb99cf9655b377db1a9e47fa4479e3330ea96f4123c6c8200e482704bf1eda2"}, - {file = "pydantic-1.10.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2185a3b3d98ab4506a3f6707569802d2d92c3a7ba3a9a35683a7709ea6c2aaa2"}, - {file = "pydantic-1.10.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f582cac9d11c227c652d3ce8ee223d94eb06f4228b52a8adaafa9fa62e73d5c9"}, - {file = "pydantic-1.10.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c9e5b778b6842f135902e2d82624008c6a79710207e28e86966cd136c621bfee"}, - {file = "pydantic-1.10.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:72ef3783be8cbdef6bca034606a5de3862be6b72415dc5cb1fb8ddbac110049a"}, - {file = "pydantic-1.10.5-cp310-cp310-win_amd64.whl", hash = "sha256:45edea10b75d3da43cfda12f3792833a3fa70b6eee4db1ed6aed528cef17c74e"}, - {file = "pydantic-1.10.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:63200cd8af1af2c07964546b7bc8f217e8bda9d0a2ef0ee0c797b36353914984"}, - {file = "pydantic-1.10.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:305d0376c516b0dfa1dbefeae8c21042b57b496892d721905a6ec6b79494a66d"}, - {file = "pydantic-1.10.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1fd326aff5d6c36f05735c7c9b3d5b0e933b4ca52ad0b6e4b38038d82703d35b"}, - {file = "pydantic-1.10.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6bb0452d7b8516178c969d305d9630a3c9b8cf16fcf4713261c9ebd465af0d73"}, - {file = "pydantic-1.10.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:9a9d9155e2a9f38b2eb9374c88f02fd4d6851ae17b65ee786a87d032f87008f8"}, - {file = "pydantic-1.10.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:f836444b4c5ece128b23ec36a446c9ab7f9b0f7981d0d27e13a7c366ee163f8a"}, - {file = "pydantic-1.10.5-cp311-cp311-win_amd64.whl", hash = "sha256:8481dca324e1c7b715ce091a698b181054d22072e848b6fc7895cd86f79b4449"}, - {file = "pydantic-1.10.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:87f831e81ea0589cd18257f84386bf30154c5f4bed373b7b75e5cb0b5d53ea87"}, - {file = "pydantic-1.10.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ce1612e98c6326f10888df951a26ec1a577d8df49ddcaea87773bfbe23ba5cc"}, - {file = "pydantic-1.10.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:58e41dd1e977531ac6073b11baac8c013f3cd8706a01d3dc74e86955be8b2c0c"}, - {file = "pydantic-1.10.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:6a4b0aab29061262065bbdede617ef99cc5914d1bf0ddc8bcd8e3d7928d85bd6"}, - {file = "pydantic-1.10.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:36e44a4de37b8aecffa81c081dbfe42c4d2bf9f6dff34d03dce157ec65eb0f15"}, - {file = "pydantic-1.10.5-cp37-cp37m-win_amd64.whl", hash = "sha256:261f357f0aecda005934e413dfd7aa4077004a174dafe414a8325e6098a8e419"}, - {file = "pydantic-1.10.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b429f7c457aebb7fbe7cd69c418d1cd7c6fdc4d3c8697f45af78b8d5a7955760"}, - {file = "pydantic-1.10.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:663d2dd78596c5fa3eb996bc3f34b8c2a592648ad10008f98d1348be7ae212fb"}, - {file = "pydantic-1.10.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51782fd81f09edcf265823c3bf43ff36d00db246eca39ee765ef58dc8421a642"}, - {file = "pydantic-1.10.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c428c0f64a86661fb4873495c4fac430ec7a7cef2b8c1c28f3d1a7277f9ea5ab"}, - {file = "pydantic-1.10.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:76c930ad0746c70f0368c4596020b736ab65b473c1f9b3872310a835d852eb19"}, - {file = "pydantic-1.10.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:3257bd714de9db2102b742570a56bf7978e90441193acac109b1f500290f5718"}, - {file = "pydantic-1.10.5-cp38-cp38-win_amd64.whl", hash = "sha256:f5bee6c523d13944a1fdc6f0525bc86dbbd94372f17b83fa6331aabacc8fd08e"}, - {file = "pydantic-1.10.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:532e97c35719f137ee5405bd3eeddc5c06eb91a032bc755a44e34a712420daf3"}, - {file = "pydantic-1.10.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ca9075ab3de9e48b75fa8ccb897c34ccc1519177ad8841d99f7fd74cf43be5bf"}, - {file = "pydantic-1.10.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bd46a0e6296346c477e59a954da57beaf9c538da37b9df482e50f836e4a7d4bb"}, - {file = "pydantic-1.10.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3353072625ea2a9a6c81ad01b91e5c07fa70deb06368c71307529abf70d23325"}, - {file = "pydantic-1.10.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:3f9d9b2be177c3cb6027cd67fbf323586417868c06c3c85d0d101703136e6b31"}, - {file = "pydantic-1.10.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:b473d00ccd5c2061fd896ac127b7755baad233f8d996ea288af14ae09f8e0d1e"}, - {file = "pydantic-1.10.5-cp39-cp39-win_amd64.whl", hash = "sha256:5f3bc8f103b56a8c88021d481410874b1f13edf6e838da607dcb57ecff9b4594"}, - {file = "pydantic-1.10.5-py3-none-any.whl", hash = "sha256:7c5b94d598c90f2f46b3a983ffb46ab806a67099d118ae0da7ef21a2a4033b28"}, - {file = "pydantic-1.10.5.tar.gz", hash = "sha256:9e337ac83686645a46db0e825acceea8e02fca4062483f40e9ae178e8bd1103a"}, + {file = "pydantic-1.10.6-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f9289065611c48147c1dd1fd344e9d57ab45f1d99b0fb26c51f1cf72cd9bcd31"}, + {file = "pydantic-1.10.6-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8c32b6bba301490d9bb2bf5f631907803135e8085b6aa3e5fe5a770d46dd0160"}, + {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fd9b9e98068fa1068edfc9eabde70a7132017bdd4f362f8b4fd0abed79c33083"}, + {file = "pydantic-1.10.6-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1c84583b9df62522829cbc46e2b22e0ec11445625b5acd70c5681ce09c9b11c4"}, + {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:b41822064585fea56d0116aa431fbd5137ce69dfe837b599e310034171996084"}, + {file = "pydantic-1.10.6-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:61f1f08adfaa9cc02e0cbc94f478140385cbd52d5b3c5a657c2fceb15de8d1fb"}, + {file = "pydantic-1.10.6-cp310-cp310-win_amd64.whl", hash = "sha256:32937835e525d92c98a1512218db4eed9ddc8f4ee2a78382d77f54341972c0e7"}, + {file = "pydantic-1.10.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:bbd5c531b22928e63d0cb1868dee76123456e1de2f1cb45879e9e7a3f3f1779b"}, + {file = "pydantic-1.10.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:e277bd18339177daa62a294256869bbe84df1fb592be2716ec62627bb8d7c81d"}, + {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89f15277d720aa57e173954d237628a8d304896364b9de745dcb722f584812c7"}, + {file = "pydantic-1.10.6-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b243b564cea2576725e77aeeda54e3e0229a168bc587d536cd69941e6797543d"}, + {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:3ce13a558b484c9ae48a6a7c184b1ba0e5588c5525482681db418268e5f86186"}, + {file = "pydantic-1.10.6-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:3ac1cd4deed871dfe0c5f63721e29debf03e2deefa41b3ed5eb5f5df287c7b70"}, + {file = "pydantic-1.10.6-cp311-cp311-win_amd64.whl", hash = "sha256:b1eb6610330a1dfba9ce142ada792f26bbef1255b75f538196a39e9e90388bf4"}, + {file = "pydantic-1.10.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4ca83739c1263a044ec8b79df4eefc34bbac87191f0a513d00dd47d46e307a65"}, + {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ea4e2a7cb409951988e79a469f609bba998a576e6d7b9791ae5d1e0619e1c0f2"}, + {file = "pydantic-1.10.6-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:53de12b4608290992a943801d7756f18a37b7aee284b9ffa794ee8ea8153f8e2"}, + {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:60184e80aac3b56933c71c48d6181e630b0fbc61ae455a63322a66a23c14731a"}, + {file = "pydantic-1.10.6-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:415a3f719ce518e95a92effc7ee30118a25c3d032455d13e121e3840985f2efd"}, + {file = "pydantic-1.10.6-cp37-cp37m-win_amd64.whl", hash = "sha256:72cb30894a34d3a7ab6d959b45a70abac8a2a93b6480fc5a7bfbd9c935bdc4fb"}, + {file = "pydantic-1.10.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:3091d2eaeda25391405e36c2fc2ed102b48bac4b384d42b2267310abae350ca6"}, + {file = "pydantic-1.10.6-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:751f008cd2afe812a781fd6aa2fb66c620ca2e1a13b6a2152b1ad51553cb4b77"}, + {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:12e837fd320dd30bd625be1b101e3b62edc096a49835392dcf418f1a5ac2b832"}, + {file = "pydantic-1.10.6-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:587d92831d0115874d766b1f5fddcdde0c5b6c60f8c6111a394078ec227fca6d"}, + {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:476f6674303ae7965730a382a8e8d7fae18b8004b7b69a56c3d8fa93968aa21c"}, + {file = "pydantic-1.10.6-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:3a2be0a0f32c83265fd71a45027201e1278beaa82ea88ea5b345eea6afa9ac7f"}, + {file = "pydantic-1.10.6-cp38-cp38-win_amd64.whl", hash = "sha256:0abd9c60eee6201b853b6c4be104edfba4f8f6c5f3623f8e1dba90634d63eb35"}, + {file = "pydantic-1.10.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6195ca908045054dd2d57eb9c39a5fe86409968b8040de8c2240186da0769da7"}, + {file = "pydantic-1.10.6-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:43cdeca8d30de9a897440e3fb8866f827c4c31f6c73838e3a01a14b03b067b1d"}, + {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4c19eb5163167489cb1e0161ae9220dadd4fc609a42649e7e84a8fa8fff7a80f"}, + {file = "pydantic-1.10.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:012c99a9c0d18cfde7469aa1ebff922e24b0c706d03ead96940f5465f2c9cf62"}, + {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:528dcf7ec49fb5a84bf6fe346c1cc3c55b0e7603c2123881996ca3ad79db5bfc"}, + {file = "pydantic-1.10.6-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:163e79386c3547c49366e959d01e37fc30252285a70619ffc1b10ede4758250a"}, + {file = "pydantic-1.10.6-cp39-cp39-win_amd64.whl", hash = "sha256:189318051c3d57821f7233ecc94708767dd67687a614a4e8f92b4a020d4ffd06"}, + {file = "pydantic-1.10.6-py3-none-any.whl", hash = "sha256:acc6783751ac9c9bc4680379edd6d286468a1dc8d7d9906cd6f1186ed682b2b0"}, + {file = "pydantic-1.10.6.tar.gz", hash = "sha256:cf95adb0d1671fc38d8c43dd921ad5814a735e7d9b4d9e437c088002863854fd"}, ] [package.dependencies] @@ -1527,14 +1527,14 @@ tomli = {version = "*", markers = "python_version < \"3.11\""} [[package]] name = "pytest" -version = "7.2.1" +version = "7.2.2" description = "pytest: simple powerful testing with Python" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.2.1-py3-none-any.whl", hash = "sha256:c7c6ca206e93355074ae32f7403e8ea12163b1163c976fee7d4d84027c162be5"}, - {file = "pytest-7.2.1.tar.gz", hash = "sha256:d45e0952f3727241918b8fd0f376f5ff6b301cc0777c6f9a556935c92d8a7d42"}, + {file = "pytest-7.2.2-py3-none-any.whl", hash = "sha256:130328f552dcfac0b1cec75c12e3f005619dc5f874f0a06e8ff7263f0ee6225e"}, + {file = "pytest-7.2.2.tar.gz", hash = "sha256:c99ab0c73aceb050f68929bc93af19ab6db0558791c6a0715723abe9d0ade9d4"}, ] [package.dependencies] @@ -1662,89 +1662,89 @@ files = [ [[package]] name = "pyzmq" -version = "25.0.0" +version = "25.0.1" description = "Python bindings for 0MQ" category = "main" optional = false python-versions = ">=3.6" files = [ - {file = "pyzmq-25.0.0-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:2d05d904f03ddf1e0d83d97341354dfe52244a619b5a1440a5f47a5b3451e84e"}, - {file = "pyzmq-25.0.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0a154ef810d44f9d28868be04641f837374a64e7449df98d9208e76c260c7ef1"}, - {file = "pyzmq-25.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:487305c2a011fdcf3db1f24e8814bb76d23bc4d2f46e145bc80316a59a9aa07d"}, - {file = "pyzmq-25.0.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2e7b87638ee30ab13230e37ce5331b3e730b1e0dda30120b9eeec3540ed292c8"}, - {file = "pyzmq-25.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:75243e422e85a62f0ab7953dc315452a56b2c6a7e7d1a3c3109ac3cc57ed6b47"}, - {file = "pyzmq-25.0.0-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:31e523d067ce44a04e876bed3ff9ea1ff8d1b6636d16e5fcace9d22f8c564369"}, - {file = "pyzmq-25.0.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:8539216173135e9e89f6b1cc392e74e6b935b91e8c76106cf50e7a02ab02efe5"}, - {file = "pyzmq-25.0.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:2754fa68da08a854f4816e05160137fa938a2347276471103d31e04bcee5365c"}, - {file = "pyzmq-25.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:4a1bc30f0c18444d51e9b0d0dd39e3a4e7c53ee74190bebef238cd58de577ea9"}, - {file = "pyzmq-25.0.0-cp310-cp310-win32.whl", hash = "sha256:01d53958c787cfea34091fcb8ef36003dbb7913b8e9f8f62a0715234ebc98b70"}, - {file = "pyzmq-25.0.0-cp310-cp310-win_amd64.whl", hash = "sha256:58fc3ad5e1cfd2e6d24741fbb1e216b388115d31b0ca6670f894187f280b6ba6"}, - {file = "pyzmq-25.0.0-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:e4bba04ea779a3d7ef25a821bb63fd0939142c88e7813e5bd9c6265a20c523a2"}, - {file = "pyzmq-25.0.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:af1fbfb7ad6ac0009ccee33c90a1d303431c7fb594335eb97760988727a37577"}, - {file = "pyzmq-25.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:85456f0d8f3268eecd63dede3b99d5bd8d3b306310c37d4c15141111d22baeaf"}, - {file = "pyzmq-25.0.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0645b5a2d2a06fd8eb738018490c514907f7488bf9359c6ee9d92f62e844b76f"}, - {file = "pyzmq-25.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9f72ea279b2941a5203e935a4588b9ba8a48aeb9a926d9dfa1986278bd362cb8"}, - {file = "pyzmq-25.0.0-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:4e295f7928a31ae0f657e848c5045ba6d693fe8921205f408ca3804b1b236968"}, - {file = "pyzmq-25.0.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:ac97e7d647d5519bcef48dd8d3d331f72975afa5c4496c95f6e854686f45e2d9"}, - {file = "pyzmq-25.0.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:656281d496aaf9ca4fd4cea84e6d893e3361057c4707bd38618f7e811759103c"}, - {file = "pyzmq-25.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:1f6116991568aac48b94d6d8aaed6157d407942ea385335a6ed313692777fb9d"}, - {file = "pyzmq-25.0.0-cp311-cp311-win32.whl", hash = "sha256:0282bba9aee6e0346aa27d6c69b5f7df72b5a964c91958fc9e0c62dcae5fdcdc"}, - {file = "pyzmq-25.0.0-cp311-cp311-win_amd64.whl", hash = "sha256:526f884a27e8bba62fe1f4e07c62be2cfe492b6d432a8fdc4210397f8cf15331"}, - {file = "pyzmq-25.0.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:ccb3e1a863222afdbda42b7ca8ac8569959593d7abd44f5a709177d6fa27d266"}, - {file = "pyzmq-25.0.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4046d03100aca266e70d54a35694cb35d6654cfbef633e848b3c4a8d64b9d187"}, - {file = "pyzmq-25.0.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3100dddcada66ec5940ed6391ebf9d003cc3ede3d320748b2737553019f58230"}, - {file = "pyzmq-25.0.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:7877264aa851c19404b1bb9dbe6eed21ea0c13698be1eda3784aab3036d1c861"}, - {file = "pyzmq-25.0.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:5049e75cc99db65754a3da5f079230fb8889230cf09462ec972d884d1704a3ed"}, - {file = "pyzmq-25.0.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:81f99fb1224d36eb91557afec8cdc2264e856f3464500b55749020ce4c848ef2"}, - {file = "pyzmq-25.0.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:a1cd4a95f176cdc0ee0a82d49d5830f13ae6015d89decbf834c273bc33eeb3d3"}, - {file = "pyzmq-25.0.0-cp36-cp36m-win32.whl", hash = "sha256:926236ca003aec70574754f39703528947211a406f5c6c8b3e50eca04a9e87fc"}, - {file = "pyzmq-25.0.0-cp36-cp36m-win_amd64.whl", hash = "sha256:94f0a7289d0f5c80807c37ebb404205e7deb737e8763eb176f4770839ee2a287"}, - {file = "pyzmq-25.0.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:f3f96d452e9580cb961ece2e5a788e64abaecb1232a80e61deffb28e105ff84a"}, - {file = "pyzmq-25.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:930e6ad4f2eaac31a3d0c2130619d25db754b267487ebc186c6ad18af2a74018"}, - {file = "pyzmq-25.0.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e1081d7030a1229c8ff90120346fb7599b54f552e98fcea5170544e7c6725aab"}, - {file = "pyzmq-25.0.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:531866c491aee5a1e967c286cfa470dffac1e2a203b1afda52d62b58782651e9"}, - {file = "pyzmq-25.0.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:fc7c1421c5b1c916acf3128bf3cc7ea7f5018b58c69a6866d70c14190e600ce9"}, - {file = "pyzmq-25.0.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:9a2d5e419bd39a1edb6cdd326d831f0120ddb9b1ff397e7d73541bf393294973"}, - {file = "pyzmq-25.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:183e18742be3621acf8908903f689ec520aee3f08449bfd29f583010ca33022b"}, - {file = "pyzmq-25.0.0-cp37-cp37m-win32.whl", hash = "sha256:02f5cb60a7da1edd5591a15efa654ffe2303297a41e1b40c3c8942f8f11fc17c"}, - {file = "pyzmq-25.0.0-cp37-cp37m-win_amd64.whl", hash = "sha256:cac602e02341eaaf4edfd3e29bd3fdef672e61d4e6dfe5c1d065172aee00acee"}, - {file = "pyzmq-25.0.0-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:e14df47c1265356715d3d66e90282a645ebc077b70b3806cf47efcb7d1d630cb"}, - {file = "pyzmq-25.0.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:293a7c2128690f496057f1f1eb6074f8746058d13588389981089ec45d8fdc77"}, - {file = "pyzmq-25.0.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:731b208bc9412deeb553c9519dca47136b5a01ca66667cafd8733211941b17e4"}, - {file = "pyzmq-25.0.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b055a1cddf8035966ad13aa51edae5dc8f1bba0b5d5e06f7a843d8b83dc9b66b"}, - {file = "pyzmq-25.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:17e1cb97d573ea84d7cd97188b42ca6f611ab3ee600f6a75041294ede58e3d20"}, - {file = "pyzmq-25.0.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:60ecbfe7669d3808ffa8a7dd1487d6eb8a4015b07235e3b723d4b2a2d4de7203"}, - {file = "pyzmq-25.0.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:4c25c95416133942280faaf068d0fddfd642b927fb28aaf4ab201a738e597c1e"}, - {file = "pyzmq-25.0.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:be05504af0619d1cffa500af1e0ede69fb683f301003851f5993b5247cc2c576"}, - {file = "pyzmq-25.0.0-cp38-cp38-win32.whl", hash = "sha256:6bf3842af37af43fa953e96074ebbb5315f6a297198f805d019d788a1021dbc8"}, - {file = "pyzmq-25.0.0-cp38-cp38-win_amd64.whl", hash = "sha256:b90bb8dfbbd138558f1f284fecfe328f7653616ff9a972433a00711d9475d1a9"}, - {file = "pyzmq-25.0.0-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:62b9e80890c0d2408eb42d5d7e1fc62a5ce71be3288684788f74cf3e59ffd6e2"}, - {file = "pyzmq-25.0.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:484c2c4ee02c1edc07039f42130bd16e804b1fe81c4f428e0042e03967f40c20"}, - {file = "pyzmq-25.0.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9ca6db34b26c4d3e9b0728841ec9aa39484eee272caa97972ec8c8e231b20c7e"}, - {file = "pyzmq-25.0.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:610d2d112acd4e5501fac31010064a6c6efd716ceb968e443cae0059eb7b86de"}, - {file = "pyzmq-25.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3594c0ff604e685d7e907860b61d0e10e46c74a9ffca168f6e9e50ea934ee440"}, - {file = "pyzmq-25.0.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:c21a5f4e54a807df5afdef52b6d24ec1580153a6bcf0607f70a6e1d9fa74c5c3"}, - {file = "pyzmq-25.0.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:4725412e27612f0d7d7c2f794d89807ad0227c2fc01dd6146b39ada49c748ef9"}, - {file = "pyzmq-25.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:4d3d604fe0a67afd1aff906e54da557a5203368a99dcc50a70eef374f1d2abef"}, - {file = "pyzmq-25.0.0-cp39-cp39-win32.whl", hash = "sha256:3670e8c5644768f214a3b598fe46378a4a6f096d5fb82a67dfd3440028460565"}, - {file = "pyzmq-25.0.0-cp39-cp39-win_amd64.whl", hash = "sha256:e99629a976809fe102ef73e856cf4b2660acd82a412a51e80ba2215e523dfd0a"}, - {file = "pyzmq-25.0.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:66509c48f7446b640eeae24b60c9c1461799a27b1b0754e438582e36b5af3315"}, - {file = "pyzmq-25.0.0-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a9c464cc508177c09a5a6122b67f978f20e2954a21362bf095a0da4647e3e908"}, - {file = "pyzmq-25.0.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:28bcb2e66224a7ac2843eb632e4109d6b161479e7a2baf24e37210461485b4f1"}, - {file = "pyzmq-25.0.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a0e7ef9ac807db50b4eb6f534c5dcc22f998f5dae920cc28873d2c1d080a4fc9"}, - {file = "pyzmq-25.0.0-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:5050f5c50b58a6e38ccaf9263a356f74ef1040f5ca4030225d1cb1a858c5b7b6"}, - {file = "pyzmq-25.0.0-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:2a73af6504e0d2805e926abf136ebf536735a13c22f709be7113c2ec65b4bec3"}, - {file = "pyzmq-25.0.0-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0e8d00228db627ddd1b418c7afd81820b38575f237128c9650365f2dd6ac3443"}, - {file = "pyzmq-25.0.0-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5605621f2181f20b71f13f698944deb26a0a71af4aaf435b34dd90146092d530"}, - {file = "pyzmq-25.0.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6136bfb0e5a9cf8c60c6ac763eb21f82940a77e6758ea53516c8c7074f4ff948"}, - {file = "pyzmq-25.0.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:0a90b2480a26aef7c13cff18703ba8d68e181facb40f78873df79e6d42c1facc"}, - {file = "pyzmq-25.0.0-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:00c94fd4c9dd3c95aace0c629a7fa713627a5c80c1819326b642adf6c4b8e2a2"}, - {file = "pyzmq-25.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20638121b0bdc80777ce0ec8c1f14f1ffec0697a1f88f0b564fa4a23078791c4"}, - {file = "pyzmq-25.0.0-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b6f75b4b8574f3a8a0d6b4b52606fc75b82cb4391471be48ab0b8677c82f9ed4"}, - {file = "pyzmq-25.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4cbb885f347eba7ab7681c450dee5b14aed9f153eec224ec0c3f299273d9241f"}, - {file = "pyzmq-25.0.0-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:c48f257da280b3be6c94e05bd575eddb1373419dbb1a72c3ce64e88f29d1cd6d"}, - {file = "pyzmq-25.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:866eabf7c1315ef2e93e34230db7cbf672e0d7c626b37c11f7e870c8612c3dcc"}, - {file = "pyzmq-25.0.0.tar.gz", hash = "sha256:f330a1a2c7f89fd4b0aa4dcb7bf50243bf1c8da9a2f1efc31daf57a2046b31f2"}, + {file = "pyzmq-25.0.1-cp310-cp310-macosx_10_15_universal2.whl", hash = "sha256:94f65e13e6df035b0ae90d49adfe7891aa4e7bdeaa65265729fecc04ab3eb0fe"}, + {file = "pyzmq-25.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f0399450d970990705ce47ed65f5efed3e4627dfc80628c3798100e7b72e023b"}, + {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f29709b0431668a967d7ff0394b00a865e7b7dde827ee0a47938b705b7c4aec3"}, + {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4fee9420b34c0ab426f105926a701a3d73f878fe77f07a1b92e0b78d1e2c795c"}, + {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:57be375c6bc66b0f685cd298e5c1c3d7ee34a254145b8087aed6e25db372b0f3"}, + {file = "pyzmq-25.0.1-cp310-cp310-manylinux_2_28_x86_64.whl", hash = "sha256:a3309b2c5a5be3d48c9ade77b340361764449aa22854ac65935b1e6c0cdabe2c"}, + {file = "pyzmq-25.0.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:7574d24579e83ee8c5d3b14769e7ba895161c43a601e911dd89d449e545e00ad"}, + {file = "pyzmq-25.0.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:041d617091258133e602919b28fdce4d3e2f8aedcd1e8b34c599653bc288d59e"}, + {file = "pyzmq-25.0.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7897ba8c3fedc6b3023bad676ceb69dbf90c077ff18ae3133ba43db47417cc72"}, + {file = "pyzmq-25.0.1-cp310-cp310-win32.whl", hash = "sha256:c462f70dadbd4649e572ca7cd1e7cf3305a8c2afc53b84214c0a7c0c3af8a657"}, + {file = "pyzmq-25.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:e3a721710992cf0e213bbb7be48fb0f32202e8d01f556c196c870373bb9ad4f4"}, + {file = "pyzmq-25.0.1-cp311-cp311-macosx_10_15_universal2.whl", hash = "sha256:b0a0fcf56279b9f3acc9b36a83feb7640c51b0db444b6870e4406d002be1d514"}, + {file = "pyzmq-25.0.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:95aff52fc847ea5755d2370f86e379ba2ed6eb67a0a6f90f0e8e99c553693b81"}, + {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b55366e6c11e1ef7403d072b9867b62cf63eebd31dd038ef65bc8d65572854f6"}, + {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:64a2bc72bcad705ee42a8fe877478ddadb7e260e806562833d3d814125e28a44"}, + {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0ca66aa24422d7f324acd5cb7fc7df616eb6f0205e059393fb108702e33e90c7"}, + {file = "pyzmq-25.0.1-cp311-cp311-manylinux_2_28_x86_64.whl", hash = "sha256:58d5dfec2e2befd09b04c4683b3c984d2203cf6e054d0f9786be3826737ad612"}, + {file = "pyzmq-25.0.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:3549292d65987e422e2c9f105b1485448381f489d8a6b6b040fc8b8f497bd578"}, + {file = "pyzmq-25.0.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:5b1ca8b0df50d1ac88857ffe9ebd1347e0a5bb5f6e1d99940fdd7df0ffdefb49"}, + {file = "pyzmq-25.0.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:a1a107e89cdcf799060ba4fa85fd3c942e19df7b24eb2600618b2406cc73c18e"}, + {file = "pyzmq-25.0.1-cp311-cp311-win32.whl", hash = "sha256:0f22ba4e9041549a5a3f5a545169dda52fa0aa7b5ef46b336cbe6679c4c3c134"}, + {file = "pyzmq-25.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:0644c0d5c73e4bfeee8148f638ab16ad783df1c4d6c2f968552a26a43fb002a1"}, + {file = "pyzmq-25.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:c5eb4b17d73b1fc208a4faa6b5918983ccc961770aa37741891f61db302dae4e"}, + {file = "pyzmq-25.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:649dd55948144a108041397f07c1299086ce1c85c2e166831db3a33dac1d0c7f"}, + {file = "pyzmq-25.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c99fd8d3efc138d6a7fb1e822133f62bb18ffec66dc6d398dcb2ac2ab8eb2cb0"}, + {file = "pyzmq-25.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:d72d69d4bb37c05a446d10bc40b391cf8fb7572654fb73fa69e7d2a395197e65"}, + {file = "pyzmq-25.0.1-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:036dbf8373aed4ccf56d58c561b23601b8f33919ec1093d8c77b37ac1259702d"}, + {file = "pyzmq-25.0.1-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:861c37649c75a2ecfc2034a32b9d5ca744e1e0cddcbf65afbd8027cf7d9755be"}, + {file = "pyzmq-25.0.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:92f04d63aecbb71d41f7db5f988167ef429f96d8197fd46684688cdb513e8a2e"}, + {file = "pyzmq-25.0.1-cp36-cp36m-win32.whl", hash = "sha256:866a4e918f1f4b2f83e9982b817df257910e3e50e456ffa74f141a10adcd11d1"}, + {file = "pyzmq-25.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:ec29c880b82cd38a63810a93b77e13f167e05732049101947772eed9ae805097"}, + {file = "pyzmq-25.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0241a334e39aa74e4ba0ae5f9e29521f1b48b8d56bf707f25f322c04eb423e99"}, + {file = "pyzmq-25.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f3b7032f55b1ed2cd8c349a89e467dca2338b7765fab82cb64c3504e49adaf51"}, + {file = "pyzmq-25.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:960f98f562ee6a50ecf283bc62479d00f5ee10e9068a21683b9e961cd87c9261"}, + {file = "pyzmq-25.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:835da498b71570d56e5526de4d5b36fa10dd9b8a82e2c405f963afeb51ff5bdc"}, + {file = "pyzmq-25.0.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:21de2ef6099fa8d6a3c2dc15aaca58e9f9ffdcc7b82a246590aa9564815699d9"}, + {file = "pyzmq-25.0.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:1e448a5a294958e915a7e1b664e6fbfcd3814989d381fb068673317f6f3ea3f8"}, + {file = "pyzmq-25.0.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:40d909bdc8a2d64ad260925154712602ee6a0425ae0b08bce78a19adfdc2f05b"}, + {file = "pyzmq-25.0.1-cp37-cp37m-win32.whl", hash = "sha256:6ff37f2b818df25c887fd40bb434569db7ff66b35f5dfff6f40cc476aee92e3f"}, + {file = "pyzmq-25.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:f66ee27a0221771bbaa2cce456e8ca890569c3d18b08b955eb6420c12516537c"}, + {file = "pyzmq-25.0.1-cp38-cp38-macosx_10_15_universal2.whl", hash = "sha256:1003bbae89435eadec03b4fa3bb6516dd1529fb09ae5704284f7400cc77009ba"}, + {file = "pyzmq-25.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:dde7a65a8bfa88aa1721add504320f8344272542291ce4e7c77993fa32901567"}, + {file = "pyzmq-25.0.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:20b6155429d3b57e9e7bd11f1680985ef8b5b0868f1a64073fb8c01326c7c80c"}, + {file = "pyzmq-25.0.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e37a764cbf91c1ed9a02e4fede79a414284aca2a0b7d92d82a3c7b82d678ec2d"}, + {file = "pyzmq-25.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:aa56a362066b3a853a64d35693a08046f640961efcc0e7643768916403e72e70"}, + {file = "pyzmq-25.0.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c4bdf1241886d39d816535d3ef9fc325bbf02470c9fd5f2cb62706eeb834f7f2"}, + {file = "pyzmq-25.0.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:446acbac24427ef42bff61a807ddcad8d03df78fb976184a4d7d6f4b1e7d8a67"}, + {file = "pyzmq-25.0.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b39847501d229e5fab155d88a565edfb182cdd3f7046f15a7f2df9c77cdc422d"}, + {file = "pyzmq-25.0.1-cp38-cp38-win32.whl", hash = "sha256:cba6b81b653d789d76e438c2e77b49f610b23e84b3bb43b99100f08a0a5d637b"}, + {file = "pyzmq-25.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:6eca6b90c4fb290efd27582780b5eaf048887a32b2c5fcd6330819192cb07b38"}, + {file = "pyzmq-25.0.1-cp39-cp39-macosx_10_15_universal2.whl", hash = "sha256:58207a6709e53b723105bac6bb3c6795ee134f7e71351f39c09d52ac235c6b0d"}, + {file = "pyzmq-25.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c62084f37682e7ee4064e8310078be4f6f7687bf528ae5761e2ba7216c5b8949"}, + {file = "pyzmq-25.0.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:9c44e9f04f8ed99c6f2e9e49f29d400d7557dd9e9e3f64e1e8a595aedc4258a2"}, + {file = "pyzmq-25.0.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c635d1c40d341835066931a018e378428dfbe0347ed4bb45a6b57f7d8c34196e"}, + {file = "pyzmq-25.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:eef93b5574c9ff36b4be376555efd369bd55b99bcc7be72f23bd38102dd9392b"}, + {file = "pyzmq-25.0.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:44bc81099ab33388f6c061c1b194307d877428cb2b18282d0385584d5c73ed72"}, + {file = "pyzmq-25.0.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6d988844ed6caa21b0076b64671e83a136d93c57f1ae5a72b915661af55d313b"}, + {file = "pyzmq-25.0.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:9d5eb6e88ae8a8734f239ffe1ed90559a426cf5b859b8ee66e0cd43fc5daf5c9"}, + {file = "pyzmq-25.0.1-cp39-cp39-win32.whl", hash = "sha256:f6b45db9de4c8adbf5fda58e827a32315d282cfb01e54dc74e7c7ccc0988c010"}, + {file = "pyzmq-25.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:47eeb94b78aa442568b85ad28f85bd37a9c3c34d052cbf8ebf8622c45f23a9cd"}, + {file = "pyzmq-25.0.1-pp37-pypy37_pp73-macosx_10_9_x86_64.whl", hash = "sha256:0ed7475f3adf0c7750d75740b3267947b501a33f4625ceae709fda2e75ec9ed7"}, + {file = "pyzmq-25.0.1-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:6d09c22ed4d0afcc662d17c2429a03fc1fae7fe7e3bc1f413e744bccfeaabdc3"}, + {file = "pyzmq-25.0.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:703ec5f5a8369c09d8f3eb626358bdb590a2b1375bcce8b7da01b3a03f8b8668"}, + {file = "pyzmq-25.0.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:20aea31cc0d1f6c3fb4685db08b4c771545cf3fed3c4b4c8942c0a4e97042ec8"}, + {file = "pyzmq-25.0.1-pp37-pypy37_pp73-win_amd64.whl", hash = "sha256:b1c03b942557bb366fd3dc377a15763d5d688de1328228136c75e50f968333cc"}, + {file = "pyzmq-25.0.1-pp38-pypy38_pp73-macosx_10_9_x86_64.whl", hash = "sha256:4e8a5ced9d92837f52ccdae6351c627b5012669727bc3eede2dc0f581eca1d0e"}, + {file = "pyzmq-25.0.1-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:d78f840d88244272fb7252e47522b1179833aff7ec64583bda3d21259c9c2c20"}, + {file = "pyzmq-25.0.1-pp38-pypy38_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:c3f78fa80780e24d294f9421123cb3bd3b68677953c53da85273a22d1c983298"}, + {file = "pyzmq-25.0.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f6de4305e02560111a5d4555758faa85d44a5bff70cccff58dbf30c81a079f0"}, + {file = "pyzmq-25.0.1-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:34a1b1a8ce9b20e01aba71b9279d9b1d4e5980a6a4e42092180e16628a444ca1"}, + {file = "pyzmq-25.0.1-pp39-pypy39_pp73-macosx_10_9_x86_64.whl", hash = "sha256:625759a0112af7c3fb560de5724d749729f00b901f7625d1a3f3fb38897544b1"}, + {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8cff159b21438c24476a49865f3d5700c9cc5833600661bc0e672decec2ff357"}, + {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4cc47652d990de9ef967c494c526d73920ef064fef0444355a7cebec6fc50542"}, + {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:44db5162a6881f7d740dec65917f38f9bfbc5ad9a10e06d7d5deebb27eb63939"}, + {file = "pyzmq-25.0.1-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:f38bf2c60a3f7b87cf5177043eb7a331a4f53bc9305a2452decbd42ad0c98741"}, + {file = "pyzmq-25.0.1-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:b1cf4becd15669bc62a41c1b1bb742e22ac25965134e4254cde82a4dc2554b1b"}, + {file = "pyzmq-25.0.1.tar.gz", hash = "sha256:44a24f7ce44e70d20e2a4c9ba5af70b4611df7a4b920eed2c8e0bdd5a5af225f"}, ] [package.dependencies] @@ -1876,14 +1876,14 @@ use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"] [[package]] name = "setuptools" -version = "67.4.0" +version = "67.6.0" description = "Easily download, build, install, upgrade, and uninstall Python packages" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "setuptools-67.4.0-py3-none-any.whl", hash = "sha256:f106dee1b506dee5102cc3f3e9e68137bbad6d47b616be7991714b0c62204251"}, - {file = "setuptools-67.4.0.tar.gz", hash = "sha256:e5fd0a713141a4a105412233c63dc4e17ba0090c8e8334594ac790ec97792330"}, + {file = "setuptools-67.6.0-py3-none-any.whl", hash = "sha256:b78aaa36f6b90a074c1fa651168723acbf45d14cb1196b6f02c0fd07f17623b2"}, + {file = "setuptools-67.6.0.tar.gz", hash = "sha256:2ee892cd5f29f3373097f5a814697e397cf3ce313616df0af11231e2ad118077"}, ] [package.extras] @@ -2006,14 +2006,14 @@ files = [ [[package]] name = "urllib3" -version = "1.26.14" +version = "1.26.15" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ - {file = "urllib3-1.26.14-py2.py3-none-any.whl", hash = "sha256:75edcdc2f7d85b137124a6c3c9fc3933cdeaa12ecb9a6a959f22797a0feca7e1"}, - {file = "urllib3-1.26.14.tar.gz", hash = "sha256:076907bf8fd355cde77728471316625a4d2f7e713c125f51953bb5b3eecf4f72"}, + {file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, + {file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, ] [package.extras] @@ -2068,14 +2068,14 @@ test = ["Cython (>=0.29.32,<0.30.0)", "aiohttp", "flake8 (>=3.9.2,<3.10.0)", "my [[package]] name = "virtualenv" -version = "20.20.0" +version = "20.21.0" description = "Virtual Python Environment builder" category = "dev" optional = false python-versions = ">=3.7" files = [ - {file = "virtualenv-20.20.0-py3-none-any.whl", hash = "sha256:3c22fa5a7c7aa106ced59934d2c20a2ecb7f49b4130b8bf444178a16b880fa45"}, - {file = "virtualenv-20.20.0.tar.gz", hash = "sha256:a8a4b8ca1e28f864b7514a253f98c1d62b64e31e77325ba279248c65fb4fcef4"}, + {file = "virtualenv-20.21.0-py3-none-any.whl", hash = "sha256:31712f8f2a17bd06234fa97fdf19609e789dd4e3e4bf108c3da71d710651adbc"}, + {file = "virtualenv-20.21.0.tar.gz", hash = "sha256:f50e3e60f990a0757c9b68333c9fdaa72d7188caa417f96af9e52407831a3b68"}, ] [package.dependencies] @@ -2089,18 +2089,18 @@ test = ["covdefaults (>=2.2.2)", "coverage (>=7.1)", "coverage-enable-subprocess [[package]] name = "wheel" -version = "0.38.4" +version = "0.40.0" description = "A built-package format for Python" category = "main" optional = false python-versions = ">=3.7" files = [ - {file = "wheel-0.38.4-py3-none-any.whl", hash = "sha256:b60533f3f5d530e971d6737ca6d58681ee434818fab630c83a734bb10c083ce8"}, - {file = "wheel-0.38.4.tar.gz", hash = "sha256:965f5259b566725405b05e7cf774052044b1ed30119b5d586b2703aafe8719ac"}, + {file = "wheel-0.40.0-py3-none-any.whl", hash = "sha256:d236b20e7cb522daf2390fa84c55eea81c5c30190f90f29ae2ca1ad8355bf247"}, + {file = "wheel-0.40.0.tar.gz", hash = "sha256:cd1196f3faee2b31968d626e1731c94f99cbdb67cf5a46e4f5656cbee7738873"}, ] [package.extras] -test = ["pytest (>=3.0.0)"] +test = ["pytest (>=6.0.0)"] [[package]] name = "yarl" @@ -2200,4 +2200,4 @@ voice = ["PyNaCl"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "76b8672b23c518cb77bf7e0eb2582150ce6b08765eae71bf3f61966d42292434" +content-hash = "12efabbb22315875a0548dea69890b8e9ace22afe79bad43b56246698abb6d46" diff --git a/pyproject.toml b/pyproject.toml index 7cf06fc3..bf17d989 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -43,7 +43,7 @@ black = "^22.10.0" isort = "^5.10.1" pre-commit = "^2.13.0" pyproject-flake8 = "^0.0.1-alpha.2" -aerich = "^0.6.2" +aerich = "0.7.1" [tool.poetry.group.test] @@ -84,8 +84,8 @@ multi_line_output = 3 lines_after_imports = 2 [tool.aerich] -tortoise_orm = "config.TORTOISE_ORM" -location = "./migrations" +tortoise_orm = "aerichConfig.t" +location = "./src/main/migrations" src_folder = "./." [tool.pytest.ini_options] diff --git a/src/main/migrations/models/0_20211009115827_init.sql b/src/main/migrations/models/0_20211009115827_init.sql deleted file mode 100644 index 3dbc6827..00000000 --- a/src/main/migrations/models/0_20211009115827_init.sql +++ /dev/null @@ -1,87 +0,0 @@ --- upgrade -- -CREATE TABLE IF NOT EXISTS "commands" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "type" TEXT NOT NULL, - "name" TEXT NOT NULL, - "category" TEXT NOT NULL, - "description" TEXT, - "content" TEXT NOT NULL, - "url" TEXT, - "uses" BIGINT NOT NULL DEFAULT 0, - "ownerId" BIGINT NOT NULL, - "createdAt" TIMESTAMP NOT NULL, - "visibility" INT NOT NULL DEFAULT 0, - "enabled" INT NOT NULL DEFAULT 1 -); -CREATE TABLE IF NOT EXISTS "guilds" ( - "id" BIGINT NOT NULL PRIMARY KEY -); -CREATE TABLE IF NOT EXISTS "caseLog" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "caseId" BIGINT NOT NULL, - "type" TEXT NOT NULL, - "modId" BIGINT NOT NULL, - "targetId" BIGINT NOT NULL, - "reason" TEXT NOT NULL, - "createdAt" TIMESTAMP NOT NULL, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "commandsLookup" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "name" TEXT NOT NULL, - "cmd_id" BIGINT NOT NULL REFERENCES "commands" ("id") ON DELETE CASCADE, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "disabled" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "command" TEXT NOT NULL, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "guildChannels" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "welcomeCh" BIGINT, - "farewellCh" BIGINT, - "modlogCh" BIGINT, - "purgatoryCh" BIGINT, - "announcementCh" BIGINT, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "guildConfigs" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "ccMode" INT NOT NULL DEFAULT 0, - "tagMode" INT NOT NULL DEFAULT 0, - "welcomeMsg" TEXT, - "farewellMsg" TEXT, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "guildMutes" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "mutedId" BIGINT NOT NULL, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "guildRoles" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "modRole" BIGINT, - "mutedRole" BIGINT, - "autoRole" BIGINT, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "prefixes" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "prefix" TEXT NOT NULL, - "guild_id" BIGINT NOT NULL REFERENCES "guilds" ("id") ON DELETE CASCADE -); -CREATE TABLE IF NOT EXISTS "timer" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "event" TEXT NOT NULL, - "extra" JSON NOT NULL, - "expires" TIMESTAMP NOT NULL, - "created" TIMESTAMP NOT NULL, - "owner" BIGINT NOT NULL -); -CREATE TABLE IF NOT EXISTS "aerich" ( - "id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, - "version" VARCHAR(255) NOT NULL, - "app" VARCHAR(20) NOT NULL, - "content" JSON NOT NULL -); From 859dbeb398a323bcced6e55f68b448fad398fb47 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 13:20:15 +0700 Subject: [PATCH 09/26] fix: Bot hosted with docker can't get current version properly --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index fc4efc45..8d9331be 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -41,6 +41,7 @@ ENV PATH="/venv/bin:${PATH}" \ VIRTUAL_ENV="/venv" COPY --from=builder /venv /venv +COPY --from=builder /app/pyproject /app/ COPY --from=builder /app/src/ /app/src COPY assets/ /app/assets COPY docker/__main__.py ./ From 648b09b494fa6f51bcd3f7607742437c12f17f7c Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 16:16:03 +0700 Subject: [PATCH 10/26] feat: This feature released faster than thought --- src/main/core/menus.py | 2 +- src/main/exts/nsfw/nsfw.py | 67 +++++++++++++++++++++----------------- 2 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/main/core/menus.py b/src/main/core/menus.py index d684083b..c4f3d86a 100644 --- a/src/main/core/menus.py +++ b/src/main/core/menus.py @@ -92,7 +92,7 @@ def __init__( timeout: float = 180.0, ownerOnly: bool = True, ) -> None: - owner: Union[discord.User, discord.Member] = ctx.author + owner: discord.User | discord.Member = ctx.author super().__init__(owner, timeout=timeout) self.context = ctx self._message: Optional[discord.Message] = None diff --git a/src/main/exts/nsfw/nsfw.py b/src/main/exts/nsfw/nsfw.py index 121c8c35..2c7503f3 100644 --- a/src/main/exts/nsfw/nsfw.py +++ b/src/main/exts/nsfw/nsfw.py @@ -6,8 +6,12 @@ from __future__ import annotations +import typing +from typing import Literal + import aiohttp import discord +from discord import app_commands from discord.ext import commands, menus from ...core.context import Context @@ -74,7 +78,7 @@ def is_paginating(self): return not self.onlyOne async def getNeko(self): - for a in range(5): + for _ in range(5): try: async with self.session.get(NEKO_API + self.endpoint) as req: img = await req.json() @@ -85,9 +89,20 @@ async def getNeko(self): DEFAULT_NEKO = "lewd" +TAGS = Literal[ + "pussy", + "feet", + "tits", + "boobs", + "yuri", + "lesbian", + "holo", + "ahegao", + "gasm", + "ass", +] -# TODO: Slash - Stupid discord took ages to add NSFW tag class NSFW(commands.Cog, CogMixin): """NSFW Commands.""" @@ -102,28 +117,7 @@ async def cog_check(self, ctx): raise NotNSFWChannel return True - @commands.command( - aliases=( - "pussy", - "feet", - "tits", - "boobs", - "yuri", - "lesbian", - "holo", - "ahegao", - "gasm", - "ass", - ), - brief="Get hentai images from nekos.fun", - description=( - "Get hentai images from nekos.fun\n\n" - "TIPS: Use different alias to get images from different hentai " - "category" - ), - ) - async def hentai(self, ctx: Context): - aliases = {"tits": "boobs", "yuri": "lesbian", "ahegao": "gasm"} + async def showHentai(self, ctx, tag: str): endpoints = { "any": DEFAULT_NEKO, "pussy": "pussy", @@ -135,15 +129,30 @@ async def hentai(self, ctx: Context): "ass": "ass", } - invokedWith = ctx.invoked_with or "any" - - value = aliases.get(invokedWith, invokedWith) - menus = NekoMenu( ctx, NekoPageSource( self.bot.session, - endpoints.get(value, DEFAULT_NEKO), + endpoints.get(tag, DEFAULT_NEKO), ), ) await menus.start() + + commonDesc = "Get hentai images from nekos.fun" + + @app_commands.command(name="hentai", nsfw=True, description=commonDesc) + async def hentaiSlash(self, inter: discord.Interaction, tag: TAGS): + ctx = await Context.from_interaction(inter) + return await self.showHentai(ctx, tag) + + @commands.command( + aliases=typing.get_args(TAGS), + brief=commonDesc, + description=(commonDesc + "\n\n" "TIPS: Use different alias to get images from different hentai " "category"), + ) + async def hentai(self, ctx: Context): + aliases = {"tits": "boobs", "yuri": "lesbian", "ahegao": "gasm"} + invokedWith = ctx.invoked_with or "any" + + tag = aliases.get(invokedWith, invokedWith) + return await self.showHentai(ctx, tag) From 2d9ad3098b9fc24c1bdb6a480e674d54b21c78b9 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 16:19:17 +0700 Subject: [PATCH 11/26] chore: Don't initialize ZeroMQ at all if no port is specified --- src/main/core/bot.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/core/bot.py b/src/main/core/bot.py index a8a970fa..cc897740 100644 --- a/src/main/core/bot.py +++ b/src/main/core/bot.py @@ -232,20 +232,25 @@ async def on_ready(self) -> None: self.logger.warning("Ready: {0} (ID: {0.id})".format(self.user)) async def zmqBind(self): - context = zmq.asyncio.Context.instance() pubPort = self.config.zmqPorts.get("PUB") + subPort = self.config.zmqPorts.get("SUB") + repPort = self.config.zmqPorts.get("REP") + + if not pubPort and not subPort and not repPort: + return + + context = zmq.asyncio.Context.instance() + if pubPort: self.pubSocket = context.socket(zmq.PUB) self.pubSocket.bind(f"tcp://*:{pubPort}") - subPort = self.config.zmqPorts.get("SUB") if subPort: self.subSocket = context.socket(zmq.SUB) self.subSocket.setsockopt(zmq.SUBSCRIBE, b"") self.subSocket.bind(f"tcp://*:{subPort}") self.socketTasks.append(asyncio.create_task(self.onZMQReceivePUBMessage())) - repPort = self.config.zmqPorts.get("REP") if repPort: self.repSocket = context.socket(zmq.REP) self.repSocket.bind(f"tcp://*:{repPort}") From 36b1cef45353c22b51ae24eda7c2cd5b8345af8f Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 16:20:13 +0700 Subject: [PATCH 12/26] fix: Forgor to add .toml --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8d9331be..11798335 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -41,7 +41,7 @@ ENV PATH="/venv/bin:${PATH}" \ VIRTUAL_ENV="/venv" COPY --from=builder /venv /venv -COPY --from=builder /app/pyproject /app/ +COPY --from=builder /app/pyproject.toml /app/ COPY --from=builder /app/src/ /app/src COPY assets/ /app/assets COPY docker/__main__.py ./ From 6bb84b63e9d4ba9a731d9112359b95f08e1be693 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 16:49:44 +0700 Subject: [PATCH 13/26] ci: Support tags (releases) and canary (overhaul branch) --- .github/README.md | 2 +- .github/workflows/build.yml | 32 +++++++++++++++++++++++++++++++- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/README.md b/.github/README.md index d8c1864c..876daad7 100644 --- a/.github/README.md +++ b/.github/README.md @@ -21,7 +21,7 @@ > **Info** > -> `dev` branch is used mostly for development and generally considered as unstable, to host the bot it's recommended to use `overhaul` branch instead! +> `dev` branch is used mostly for development and generally considered as unstable, to host the bot it's recommended to use `overhaul` branch or release tags instead! **`Z3R0`** (codename **`ziBot`**) is a **free** and **open-source** multi-purpose discord bot, created for fun in the middle of quarantine. Used to be fork of [Steve-Bot](https://github.com/MCBE-Speedrunning/Steve-Bot) by MCBE Speedrunning Moderators. diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6bc48eb7..eceb7d7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,9 @@ on: push: branches: - dev + - overhaul + tags: + - 3.* permissions: contents: read @@ -31,10 +34,37 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push + - name: Get tag name + if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ziro-bot/z3r0' + run: | + set -x + echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV + + - name: Build and push (Nightly) uses: docker/build-push-action@v4 + if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' with: context: . file: ./docker/Dockerfile push: true tags: ghcr.io/ziro-bot/z3r0:nightly + + - name: Build and push (Canary) + uses: docker/build-push-action@v4 + if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' + with: + context: . + file: ./docker/Dockerfile + push: true + tags: ghcr.io/ziro-bot/z3r0:canary + + - name: Build and push (Release) + uses: docker/build-push-action@v4 + if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ziro-bot/z3r0' + with: + context: . + file: ./docker/Dockerfile + push: true + tags: | + ghcr.io/ziro-bot/z3r0:latest + ghcr.io/ziro-bot/z3r0:${{ env.VERSION_TAG }} From 471436f3f3c6591eadf8c265c0a3dbd0248f9910 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 17:00:06 +0700 Subject: [PATCH 14/26] ci: I need to escape parenthesis? --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eceb7d7b..01d2d187 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: set -x echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - - name: Build and push (Nightly) + - name: Build and push \(Nightly\) uses: docker/build-push-action@v4 if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' with: @@ -49,7 +49,7 @@ jobs: push: true tags: ghcr.io/ziro-bot/z3r0:nightly - - name: Build and push (Canary) + - name: Build and push \(Canary\) uses: docker/build-push-action@v4 if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' with: @@ -58,7 +58,7 @@ jobs: push: true tags: ghcr.io/ziro-bot/z3r0:canary - - name: Build and push (Release) + - name: Build and push \(Release\) uses: docker/build-push-action@v4 if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ziro-bot/z3r0' with: From 6b56d50b21a1f09d5ce66b0a94d32b00069c9ef2 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 17:02:22 +0700 Subject: [PATCH 15/26] revert: Revert "ci: I need to escape parenthesis?" This reverts commit 471436f3f3c6591eadf8c265c0a3dbd0248f9910. --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01d2d187..eceb7d7b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: set -x echo "VERSION_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - - name: Build and push \(Nightly\) + - name: Build and push (Nightly) uses: docker/build-push-action@v4 if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' with: @@ -49,7 +49,7 @@ jobs: push: true tags: ghcr.io/ziro-bot/z3r0:nightly - - name: Build and push \(Canary\) + - name: Build and push (Canary) uses: docker/build-push-action@v4 if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' with: @@ -58,7 +58,7 @@ jobs: push: true tags: ghcr.io/ziro-bot/z3r0:canary - - name: Build and push \(Release\) + - name: Build and push (Release) uses: docker/build-push-action@v4 if: startsWith(github.ref, 'refs/tags/') && github.repository == 'ziro-bot/z3r0' with: From b3c5a2ae889e7deae938807c47380a3ffd3a562f Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 17:20:54 +0700 Subject: [PATCH 16/26] ci: Not startsWith --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eceb7d7b..11a8eb92 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Nightly Build +name: Build on: push: @@ -42,7 +42,7 @@ jobs: - name: Build and push (Nightly) uses: docker/build-push-action@v4 - if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' + if: ${{ !startsWith(github.ref, 'refs/tags/') }} && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' with: context: . file: ./docker/Dockerfile @@ -51,7 +51,7 @@ jobs: - name: Build and push (Canary) uses: docker/build-push-action@v4 - if: !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' + if: ${{ !startsWith(github.ref, 'refs/tags/') }} && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' with: context: . file: ./docker/Dockerfile From 9db79d424c54153f5a906a0d8f2de5ef790774c7 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 17:26:39 +0700 Subject: [PATCH 17/26] ci: Dev (nightly) shouldn't push to canary --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 11a8eb92..2af2f5ff 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,7 +42,7 @@ jobs: - name: Build and push (Nightly) uses: docker/build-push-action@v4 - if: ${{ !startsWith(github.ref, 'refs/tags/') }} && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' + if: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'dev' && github.repository == 'ziro-bot/z3r0' }} with: context: . file: ./docker/Dockerfile @@ -51,7 +51,7 @@ jobs: - name: Build and push (Canary) uses: docker/build-push-action@v4 - if: ${{ !startsWith(github.ref, 'refs/tags/') }} && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' + if: ${{ !startsWith(github.ref, 'refs/tags/') && github.ref_name == 'overhaul' && github.repository == 'ziro-bot/z3r0' }} with: context: . file: ./docker/Dockerfile From b6fd2b6821f9f1aa4cb122b9d80b7b262c08be41 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 17:47:26 +0700 Subject: [PATCH 18/26] docs: Fix documentation [skip ci] --- .github/CHANGELOG.md | 2 +- .github/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 2644b49e..ca31b017 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,6 +1,6 @@ # v3.6 (Structure Refactor) -> **Info** +> **Note** > > Version 3.6.x is mostly about refactoring the project structure since > previously functions and constants are all over the place that it's starting diff --git a/.github/README.md b/.github/README.md index 876daad7..5976e3e2 100644 --- a/.github/README.md +++ b/.github/README.md @@ -19,7 +19,7 @@ ## About -> **Info** +> **Note** > > `dev` branch is used mostly for development and generally considered as unstable, to host the bot it's recommended to use `overhaul` branch or release tags instead! From f5bb5862c68d2517416e68f9f43e6c2d2fd8f151 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 17:52:00 +0700 Subject: [PATCH 19/26] docs: v3.6.0 --- .github/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index ca31b017..58e81901 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -6,7 +6,7 @@ > previously functions and constants are all over the place that it's starting > to get harder to find what I'm looking for. -## 3.6.0 (Project Structure Refactor) +## 3.6.0 (Project Structure Refactor - Part 1) ### Bugfixes - [**Fixed**] Fixed potential error related to user without avatar From c0e7607575d8ebb64ee7f5c9d7d8d48755fdb38e Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 18:11:00 +0700 Subject: [PATCH 20/26] fix(Dockerfile): TSE is not included for some reason --- docker/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 11798335..17c3a4be 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -28,6 +28,7 @@ RUN apt-get update && apt-get upgrade -y \ COPY poetry.lock pyproject.toml ./ ADD src/ ./src +ADD src/tse/ ./src/tse RUN poetry run pip install -U pip \ && poetry install --without test,dev \ --no-root -E postgresql -E mysql -E voice -E speedup @@ -43,6 +44,7 @@ ENV PATH="/venv/bin:${PATH}" \ COPY --from=builder /venv /venv COPY --from=builder /app/pyproject.toml /app/ COPY --from=builder /app/src/ /app/src +COPY --from=builder /app/src/tse/ /app/src/tse COPY assets/ /app/assets COPY docker/__main__.py ./ From cdb4b1bcea9adfa923a85529c9eea88c25dbf4ad Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 18:18:07 +0700 Subject: [PATCH 21/26] fix?: Hopefully fix tse issue --- src/main/exts/meta/_custom_command.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/exts/meta/_custom_command.py b/src/main/exts/meta/_custom_command.py index a7a6ea1b..b6cffffb 100644 --- a/src/main/exts/meta/_custom_command.py +++ b/src/main/exts/meta/_custom_command.py @@ -9,7 +9,7 @@ import discord from discord.ext import commands -import tse +from src import tse from ...core import checks, db from ...core.context import Context From 1e87ff61942e70a6d3f27e8d390ba86c45309554 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 18:22:39 +0700 Subject: [PATCH 22/26] fix: Temporarily remove aerich.models --- src/main/core/config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/core/config.py b/src/main/core/config.py index a9e6ea0a..7884ae6c 100644 --- a/src/main/core/config.py +++ b/src/main/core/config.py @@ -65,7 +65,8 @@ def tortoiseConfig(self): "connections": {"default": self.databaseUrl}, "apps": { "models": { - "models": [mainModel, "aerich.models"], + # "models": [mainModel, "aerich.models"], + "models": [mainModel], "default_connection": "default", }, }, From 61ee4bde930c3b04053c0a5cfed958facae7b987 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 18:32:22 +0700 Subject: [PATCH 23/26] fix: Another TSE issue --- src/main/exts/events/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/exts/events/events.py b/src/main/exts/events/events.py index ef78eb23..7279b78b 100644 --- a/src/main/exts/events/events.py +++ b/src/main/exts/events/events.py @@ -18,7 +18,7 @@ from discord.app_commands import AppCommandError from discord.ext import commands -import tse +from src import tse from ...core import errors from ...core.embed import ZEmbed From 061cf355bfac0a9cdab4d8cffe113b60c9a247e9 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 18:38:16 +0700 Subject: [PATCH 24/26] test: TSE issue --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bf17d989..96e378e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -89,4 +89,4 @@ location = "./src/main/migrations" src_folder = "./." [tool.pytest.ini_options] -pythonpath = ["src"] +pythonpath = ["."] From 36f4ca90847a5d3d87d8c305596be28b20943143 Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 18:44:21 +0700 Subject: [PATCH 25/26] chore: 3.6.1 --- .github/CHANGELOG.md | 5 +++++ aerichConfig.py | 2 +- pyproject.toml | 2 +- src/main/core/config.py | 10 ++++++++-- 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 58e81901..ae7d11b8 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -6,6 +6,11 @@ > previously functions and constants are all over the place that it's starting > to get harder to find what I'm looking for. +## 3.6.1 (Project Structure Refactor - Part 1.5 A.K.A Hotfix) + +- [**Fixed**] Fixed issues related to `import tse` +- [**Fixed**] Aerich caused the bot to crash in production environment + ## 3.6.0 (Project Structure Refactor - Part 1) ### Bugfixes diff --git a/aerichConfig.py b/aerichConfig.py index f9e4c44f..d87c1a8d 100644 --- a/aerichConfig.py +++ b/aerichConfig.py @@ -10,5 +10,5 @@ except ImportError: dbUrl = os.environ["ZIBOT_DB_URL"] -cfg = Config("", dbUrl) +cfg = Config("", dbUrl, useAerich=True) t = cfg.tortoiseConfig diff --git a/pyproject.toml b/pyproject.toml index 96e378e6..379847e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "Z3R0" -version = "3.6.0" +version = "3.6.1" description = "A multi-purpose open source discord bot" authors = ["null2264"] license = "MPL-2.0" diff --git a/src/main/core/config.py b/src/main/core/config.py index 7884ae6c..29d172ef 100644 --- a/src/main/core/config.py +++ b/src/main/core/config.py @@ -25,6 +25,7 @@ class Config: "internalApiHost", "test", "zmqPorts", + "useAerich", ) def __init__( @@ -41,6 +42,7 @@ def __init__( internalApiHost: str | None = None, test: bool = False, zmqPorts: dict[str, int] | None = None, + useAerich: bool = False, ): self.token = token self.defaultPrefix = defaultPrefix or ">" @@ -54,6 +56,7 @@ def __init__( self.internalApiHost = internalApiHost or "127.0.0.1:2264" self.test = test self.zmqPorts = zmqPorts or {} + self.useAerich = useAerich @property def tortoiseConfig(self): @@ -61,12 +64,15 @@ def tortoiseConfig(self): if not self.test: mainModel = "src." + mainModel + models = [mainModel] + if self.useAerich: + models.append("aerich.models") + return self._tortoiseConfig or { "connections": {"default": self.databaseUrl}, "apps": { "models": { - # "models": [mainModel, "aerich.models"], - "models": [mainModel], + "models": models, "default_connection": "default", }, }, From 7784781725eb4b9ce3b166bc391925a0faedf78f Mon Sep 17 00:00:00 2001 From: ziro Date: Thu, 16 Mar 2023 19:00:49 +0700 Subject: [PATCH 26/26] chore: Dockerfile doesn't seem to be the one causing TSE error --- docker/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 17c3a4be..11798335 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -28,7 +28,6 @@ RUN apt-get update && apt-get upgrade -y \ COPY poetry.lock pyproject.toml ./ ADD src/ ./src -ADD src/tse/ ./src/tse RUN poetry run pip install -U pip \ && poetry install --without test,dev \ --no-root -E postgresql -E mysql -E voice -E speedup @@ -44,7 +43,6 @@ ENV PATH="/venv/bin:${PATH}" \ COPY --from=builder /venv /venv COPY --from=builder /app/pyproject.toml /app/ COPY --from=builder /app/src/ /app/src -COPY --from=builder /app/src/tse/ /app/src/tse COPY assets/ /app/assets COPY docker/__main__.py ./