Skip to content

Commit 3f32be1

Browse files
patches and fixes and modernization (#63)
1 parent 166be83 commit 3f32be1

31 files changed

+502
-680
lines changed

config.template.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ owner_ids = [123, 456, 789] # user or role ids, optional
44
[TOKENS]
55
bot = ''
66
idevision = '' # optional key
7-
mystbin = '' # optional key
8-
pythonista = '' # optional key
7+
pythonista = '' # optional key
98

109
[DATABASE]
1110
dsn = 'postgres://pythonistabot:pythonistabot@database:5432/pythonistabot' # assumed default
@@ -19,9 +18,9 @@ domains = ["pastebin.com", "hastebin.com"]
1918
# 20 = INFO
2019
# 10 = DEBUG
2120
[LOGGING]
22-
webhook_url = "" # optional
21+
webhook_url = "" # optional
2322
webhook_avatar_url = "" # optional
24-
runner = 123456789 # optional: sets the webhook avatar url (will be overridden by the webhook_avatar_url attribute)
23+
runner = 123456789 # optional: sets the webhook avatar url (will be overridden by the webhook_avatar_url attribute)
2524
level = 20
2625

2726
[SUGGESTIONS] # optional

constants/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
from .constants import *
2425

2526
GUILD_ID: int = 490948346773635102

constants/_meta.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,22 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
from __future__ import annotations
2425

2526
from typing import TYPE_CHECKING, Any, NoReturn, cast
2627

2728
import toml
2829

2930
if TYPE_CHECKING:
30-
from typing_extensions import Self
31-
3231
from types_.config import Database, Logging, Tokens
3332

3433

3534
_config = toml.load("config.toml")
3635

3736

3837
class ConstantsMeta(type):
39-
def __new__(mcs, name: str, bases: tuple[type, ...], attrs: dict[str, Any]) -> Self:
38+
def __new__(mcs, name: str, bases: tuple[type, ...], attrs: dict[str, Any]) -> type:
4039
if name == "CONSTANTS":
4140
return super().__new__(mcs, name, bases, attrs)
4241

constants/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
from ._meta import CONSTANTS
2425

2526
__all__ = (

core/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
__version__ = "0.0.1a"
2425

2526
from . import utils as utils

core/bot.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
from __future__ import annotations
2425

2526
import datetime
@@ -106,7 +107,7 @@ async def on_error(self, event_name: str, /, *args: Any, **kwargs: Any) -> None:
106107
traceback_text = "".join(traceback.format_exception(exc_type, exception, traceback_))
107108

108109
embed.description = f"```py\n{traceback_text}\n```"
109-
embed.timestamp = datetime.datetime.now(datetime.timezone.utc)
110+
embed.timestamp = datetime.datetime.now(datetime.UTC)
110111

111112
args_str = ["```py"]
112113
for index, arg in enumerate(args):

core/checks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
from __future__ import annotations
2425

2526
from typing import TYPE_CHECKING, Any

core/converters.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
from collections import deque
2425
from typing import NamedTuple
2526

core/core.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
2222
"""
23+
2324
from __future__ import annotations
2425

2526
from typing import TYPE_CHECKING

core/errors.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
SOFTWARE.
2020
"""
21+
2122
from discord.ext import commands
2223

2324
__all__ = ("InvalidEval",)

0 commit comments

Comments
 (0)