56 lines
2.9 KiB
Python
56 lines
2.9 KiB
Python
"""MIT License
|
|
|
|
Copyright (c) 2023 - present Vocard Development
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
in the Software without restriction, including without limitation the rights
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
copies or substantial portions of the Software.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
SOFTWARE.
|
|
"""
|
|
|
|
from typing import (
|
|
Dict,
|
|
List,
|
|
Any,
|
|
Union
|
|
)
|
|
|
|
class Settings:
|
|
def __init__(self, settings: Dict) -> None:
|
|
self.token: str = settings.get("token")
|
|
self.client_id: int = int(settings.get("client_id", 0))
|
|
self.spotify_client_id: str = settings.get("spotify_client_id")
|
|
self.spotify_client_secret: str = settings.get("spotify_client_secret")
|
|
self.genius_token: str = settings.get("genius_token")
|
|
self.mongodb_url: str = settings.get("mongodb_url")
|
|
self.mongodb_name: str = settings.get("mongodb_name")
|
|
|
|
self.invite_link: str = "https://discord.gg/wRCgB7vBQv"
|
|
self.nodes: Dict[str, Dict[str, Union[str, int, bool]]] = settings.get("nodes", {})
|
|
self.max_queue: int = settings.get("default_max_queue", 1000)
|
|
self.bot_prefix: str = settings.get("prefix", "")
|
|
self.activity: List[Dict[str, str]] = settings.get("activity", [{"listen": "/help"}])
|
|
self.logging: Dict[Union[str, Dict[str, Union[str, bool]]]] = settings.get("logging", {})
|
|
self.embed_color: str = int(settings.get("embed_color", "0xb3b3b3"), 16)
|
|
self.bot_access_user: List[int] = settings.get("bot_access_user", [])
|
|
self.sources_settings: Dict[Dict[str, str]] = settings.get("sources_settings", {})
|
|
self.cooldowns_settings: Dict[str, List[int]] = settings.get("cooldowns", {})
|
|
self.aliases_settings: Dict[str, List[str]] = settings.get("aliases", {})
|
|
self.controller: Dict[str, Dict[str, Any]] = settings.get("default_controller", {})
|
|
self.voice_status_template: str = settings.get("default_voice_status_template", "")
|
|
self.lyrics_platform: str = settings.get("lyrics_platform", "A_ZLyrics").lower()
|
|
self.ipc_client: Dict[str, Union[str, bool, int]] = settings.get("ipc_client", {})
|
|
self.version: str = settings.get("version", "") |