-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
amiya.py
36 lines (29 loc) · 851 Bytes
/
amiya.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
import os
import sys
import asyncio
import core.frozen
from typing import Coroutine
from core.plugins import PluginsLoader
from core import app, bot, init_task, BotResource
def run_amiya(*tasks: Coroutine):
try:
BotResource.download_bot_resource()
sys.path += [
os.path.dirname(sys.executable),
os.path.abspath('resource/env/python-dlls'),
os.path.abspath('resource/env/python-standard-lib.zip'),
]
loader = PluginsLoader(bot)
asyncio.run(loader.load_local_plugins())
asyncio.run(
asyncio.wait(
[
*init_task,
*tasks,
]
)
)
except KeyboardInterrupt:
pass
if __name__ == '__main__':
run_amiya(bot.start(launch_browser=True), app.serve())