1
Fork 0
mirror of https://github.com/wlinator/luminara.git synced 2024-10-02 20:23:12 +00:00
Lumi/main.py
wlinator c8e3708b7e Stats command in beta mode
For now this command will be pushed with the "beta" check, so I can test the stats command on the main bot's database.
2023-06-21 06:19:02 -04:00

51 lines
1.1 KiB
Python

""" .ENV TEMPLATE
TOKEN=
OWNER_ID=
XP_GAIN=
COOLDOWN=
CASH_BALANCE_NAME=
SPECIAL_BALANCE_NAME=
"""
import logging
import os
import discord
from dotenv import load_dotenv
import db.tables
import sb_tools.resources
from config import json_loader
logging.basicConfig(level=logging.INFO)
load_dotenv('.env')
# load all strings.en-US.json strings
strings = json_loader.load_strings()
sbbot = discord.Bot(
owner_id=os.getenv('OWNER_ID'),
intents=discord.Intents.all(),
activity=discord.Game(f"v{sb_tools.resources.__version__}"),
status=discord.Status.do_not_disturb
)
@sbbot.event
async def on_ready():
# wait until the bot is ready
# then sync the sqlite3 database
db.tables.sync_database()
"""
https://docs.pycord.dev/en/stable/api/events.html#discord.on_ready
This function isn't guaranteed to only be called once.
Event is called when RESUME request fails.
"""
for filename in os.listdir('./modules'):
if filename.endswith('.py'):
sbbot.load_extension(f'modules.{filename[:-3]}')
sbbot.run(os.getenv('TOKEN'))