Skip to content
This repository was archived by the owner on Oct 24, 2022. It is now read-only.

Commit 8f91442

Browse files
Merge pull request #65 from AnotherCat/db-refactor
Use ORM
2 parents 8e8b500 + f7b1e04 commit 8f91442

29 files changed

+389
-612
lines changed

Pipfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ asyncpg = "~=0.23"
99
aiohttp = "~=3.7"
1010
jishaku = "*"
1111
discord-py-slash-command = "~=1.1"
12+
tortoise-orm = {extras = ["asyncpg"], version = "*"}
13+
aerich = "*"
1214

1315
[dev-packages]
1416
black = "==21.4b2"

Pipfile.lock

Lines changed: 137 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Message Manager
22

33
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/326569ef23ba4a46848e531a662970c0)](https://app.codacy.com/gh/AnotherCat/message-bot?utm_source=github.com&utm_medium=referral&utm_content=AnotherCat/message-bot&utm_campaign=Badge_Grade_Settings)
4-
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
5-
[![time tracker](https://wakatime.com/badge/github/AnotherCat/message-manager.svg)](https://wakatime.com/badge/github/AnotherCat/message-manager)
4+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![wakatime](https://wakatime.com/badge/github/AnotherCat/message-manager.svg)](https://wakatime.com/badge/github/AnotherCat/message-manager)
5+
66
<!--
77
[![Support Server Invite](https://discord.com/api/guilds/742373263593963614/embed.png)](https://discord.gg/xFZu29t)
88
-->
@@ -14,7 +14,7 @@ Current version: `v1.7`
1414

1515
## License
1616

17-
Message Manager is licensed under the [GNU Affero General Public License](https://github.com/AnotherCat/message-bot/blob/master/LICENSE)
17+
Message Manager is licensed under the [GNU Affero General Public License](https://github.com/AnotherCat/message-manager/blob/master/LICENSE)
1818
Here is a [simplified version](https://tldrlegal.com/license/gnu-affero-general-public-license-v3-(agpl-3.0)#summary)
1919

2020
## Invite link

aerich.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[aerich]
2+
tortoise_orm = tortoise_config.TORTOISE_ORM
3+
location = ./migrations
4+

cogs/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
from discord.ext import commands
3232

33-
from cogs.utils import Context, errors
33+
from src import Context, errors
3434
from main import Bot
3535

3636
if TYPE_CHECKING:

cogs/listing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from discord.ext import commands, tasks
2424

25-
from cogs.utils import Context, list_wrappers
25+
from src import Context, list_wrappers
2626
from main import Bot
2727

2828
if TYPE_CHECKING:

cogs/maincog.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from discord.ext import commands
2828
from discord_slash import SlashContext, cog_ext
2929

30-
from cogs.utils import Context
30+
from src import Context
3131
from main import Bot
3232

3333
if TYPE_CHECKING:
@@ -105,13 +105,13 @@ def create_privacy_embed() -> discord.Embed:
105105
embed = discord.Embed(
106106
title="Privacy Policy",
107107
description="We do store data. Please read our privacy policy.",
108-
url="https://github.com/AnotherCat/message-bot/blob/master/PRIVACY_POLICY.md",
108+
url="https://github.com/AnotherCat/message-manager/blob/master/PRIVACY_POLICY.md",
109109
colour=discord.Colour.red(),
110110
timestamp=datetime.now(timezone.utc),
111111
)
112112
embed.add_field(
113113
name="Where to find the privacy policy",
114-
value="My privacy policy is located on [github](https://github.com/AnotherCat/message-bot/blob/master/PRIVACY_POLICY.md)",
114+
value="My privacy policy is located on [github](https://github.com/AnotherCat/message-manager/blob/master/PRIVACY_POLICY.md)",
115115
)
116116
return embed
117117

@@ -139,8 +139,8 @@ def create_docs_embed() -> discord.Embed:
139139
def create_source_embed() -> discord.Embed:
140140
return discord.Embed(
141141
title="Source Code!",
142-
description="My [source code](https://github.com/AnotherCat/message-bot)",
143-
url="https://github.com/AnotherCat/message-bot",
142+
description="My [source code](https://github.com/AnotherCat/message-manager)",
143+
url="https://github.com/AnotherCat/message-manager",
144144
colour=discord.Colour(0xC387C1),
145145
timestamp=datetime.now(timezone.utc),
146146
)

cogs/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
from discord.ext import commands
3131

32-
from cogs.utils import Context, checks, errors, send_log_once
32+
from src import Context, checks, errors, send_log_once
3333
from main import Bot
3434

3535
if TYPE_CHECKING:

0 commit comments

Comments
 (0)