-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
38 lines (30 loc) · 881 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from tortoise import Tortoise, run_async
from alicebot import Bot
import plugins.sb_kicker.db as db
bot = Bot()
async def init():
# Here we create a SQLite DB using file "db.sqlite3"
# also specify the app name of "models"
# which contain models from "app.models"
await Tortoise.init(
modules={'model': 'plugins.sb_kicker.db'},
# config={
# 'apps': {
# 'models': {
# 'models': db,
# 'default_connection': 'default'
# },
# },
# 'connections': {
# 'default': "sqlite://db.sqlite3"
# }
# }
)
# Generate the schema
# await Tortoise.generate_schemas()
# @bot.bot_run_hook
# async def hook_func(_bot: Bot):
# await init()
if __name__ == "__main__":
run_async(init())
bot.run()