34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
# Copyright (C) 2022 nocturn9x
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
from pydantic import BaseModel
|
|
from typing import Optional
|
|
import os
|
|
|
|
|
|
class BotConfig(BaseModel):
|
|
"""
|
|
A container class for bot configuration variables.
|
|
Because passing around a fuckload of global variables
|
|
wasn't bad enough
|
|
"""
|
|
|
|
api_id: int
|
|
api_hash: str
|
|
bot_token: str
|
|
logging_format: str
|
|
logging_date_format: str
|
|
logging_level: int
|
|
restart_times: Optional[int] = 0
|
|
plugins_dir: Optional[str] = "modules"
|
|
working_directory: Optional[str] = os.getcwd()
|
|
session_name: Optional[str] = "userbot" |