mirror of
https://github.com/RGBCube/minearchy-bot
synced 2025-07-27 00:47:44 +00:00
feat: package with nix and docker
This commit is contained in:
parent
fb63e83312
commit
b0b82aa689
8 changed files with 118 additions and 99 deletions
|
@ -1,32 +1,27 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
from os import environ as env
|
||||
from pathlib import Path
|
||||
|
||||
from . import MinearchyBot
|
||||
|
||||
|
||||
async def main() -> None:
|
||||
config = json.loads(
|
||||
(
|
||||
Path(__file__).parent / "config.json"
|
||||
).read_text()
|
||||
)
|
||||
|
||||
async def async_main() -> None:
|
||||
env[f"JISHAKU_HIDE"] = "True"
|
||||
env[f"JISHAKU_NO_UNDERSCORE"] = "True"
|
||||
|
||||
bot = MinearchyBot(
|
||||
token = config["BOT_TOKEN"],
|
||||
webhook_url = config["WEBHOOK_URL"]
|
||||
token = env["MINEARCHY_BOT_TOKEN"],
|
||||
webhook_url = env["MINEARCHY_BOT_WEBHOOK_URL"]
|
||||
)
|
||||
|
||||
await bot.run()
|
||||
|
||||
if __name__ == "__main__":
|
||||
def main() -> None:
|
||||
try:
|
||||
asyncio.run(main())
|
||||
asyncio.run(async_main())
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue