mirror of
https://gitlab.com/octospacc/WinDog.git
synced 2025-06-05 22:09:20 +02:00
Legacy removals, code restructuring, add send_... functions and better help
This commit is contained in:
@ -1,12 +1,12 @@
|
||||
# ================================== #
|
||||
# WinDog multi-purpose chatbot #
|
||||
# Licensed under AGPLv3 by OctoSpacc #
|
||||
# ================================== #
|
||||
# ==================================== #
|
||||
# WinDog multi-purpose chatbot #
|
||||
# Licensed under AGPLv3 by OctoSpacc #
|
||||
# ==================================== #
|
||||
|
||||
from peewee import *
|
||||
from LibWinDog.Types import *
|
||||
|
||||
Db = SqliteDatabase("Database.sqlite")
|
||||
Db = SqliteDatabase("./Data/Database.sqlite")
|
||||
|
||||
class BaseModel(Model):
|
||||
class Meta:
|
||||
@ -28,3 +28,10 @@ class Room(Entity):
|
||||
|
||||
Db.create_tables([EntitySettings, User, Room], safe=True)
|
||||
|
||||
class UserSettingsData():
|
||||
def __new__(cls, user_id:str) -> SafeNamespace|None:
|
||||
try:
|
||||
return SafeNamespace(**EntitySettings.select().join(User).where(User.id == user_id).dicts().get())
|
||||
except EntitySettings.DoesNotExist:
|
||||
return None
|
||||
|
||||
|
Reference in New Issue
Block a user