Edit on GitHub

tickets_plus.database.const

Constant variables used throughout the bot.

We use this file to store static variables that are used throughout the bot. This is to keep the code clean and easy to read. We also use this file to store the bot's version number. Basically, this file is a collection of global constants.

Typical usage example:
from tickets_plus.database import statvars
# Make use of the variables in this file
print(statvars.VERSION)
 1"""Constant variables used throughout the bot.
 2
 3We use this file to store static variables that are used throughout the bot.
 4This is to keep the code clean and easy to read.
 5We also use this file to store the bot's version number.
 6Basically, this file is a collection of global constants.
 7
 8Typical usage example:
 9    ```py
10    from tickets_plus.database import statvars
11    # Make use of the variables in this file
12    print(statvars.VERSION)
13    ```
14"""
15# License: EPL-2.0
16# SPDX-License-Identifier: EPL-2.0
17# Copyright (c) 2021-present The Tickets+ Contributors
18# This Source Code may also be made available under the following
19# Secondary Licenses when the conditions for such availability set forth
20# in the Eclipse Public License, v. 2.0 are satisfied: GPL-3.0-only OR
21# If later approved by the Initial Contributor, GPL-3.0-or-later.
22
23import logging.handlers
24import pathlib
25
26import discord
27
28VERSION = "v0.3.0.0c"
29"""The current version of the bot as a string.
30
31FORMAT:
32v[major].[minor].[release].[build]
33
34MAJOR and MINOR version changes can be compatibility-breaking.
35Compatibility-breaking changes are changes that require manual intervention
36by the USER to update the bot. Internal changes that do not require
37manual intervention by the USER are not considered compatibility-breaking.
38"""
39PROG_DIR = pathlib.Path(__file__).parent.parent.parent.absolute()
40"""The absolute path to the root directory of the bot."""
41INTENTS = discord.Intents.default()
42"""The discord gateway intents that the bot uses."""
43INTENTS.message_content = True
44INTENTS.members = True
45HANDLER = logging.handlers.RotatingFileHandler(
46    filename=pathlib.Path(PROG_DIR, "log", "bot.log"),
47    encoding="utf-8",
48    mode="w",
49    backupCount=10,
50    maxBytes=100000,
51)
52"""The default logging handler for the bot."""
VERSION = 'v0.3.0.0c'

The current version of the bot as a string.

FORMAT: v[major].[minor].[release].[build]

MAJOR and MINOR version changes can be compatibility-breaking. Compatibility-breaking changes are changes that require manual intervention by the USER to update the bot. Internal changes that do not require manual intervention by the USER are not considered compatibility-breaking.

PROG_DIR = PosixPath('/home/runner/work/Tickets-Plus/Tickets-Plus')

The absolute path to the root directory of the bot.

INTENTS = <Intents value=53608191>

The discord gateway intents that the bot uses.

HANDLER = <RotatingFileHandler /home/runner/work/Tickets-Plus/Tickets-Plus/log/bot.log (NOTSET)>

The default logging handler for the bot.