mirror of
https://github.com/Xevion/contest-assistant.git
synced 2025-12-06 01:14:37 -06:00
Added and implemented helper functions for getting and fetching messages given a payload's integer channel and message IDs. Implemented Submission.votes list modifications and Submission.update in code (tested with real bot) Committed constants.py containing ReactionMarker used in models.py
25 lines
639 B
Python
25 lines
639 B
Python
import logging
|
|
import os
|
|
|
|
# Path Constants
|
|
from collections import namedtuple
|
|
|
|
BASE_DIR = os.path.dirname(os.path.abspath(os.path.join(__file__, '..')))
|
|
TOKEN = os.path.join(BASE_DIR, 'token.dat')
|
|
DATABASE = os.path.join(BASE_DIR, 'database.db')
|
|
DATABASE_URI = f'sqlite:///{DATABASE}'
|
|
|
|
# Other constants
|
|
LOGGING_LEVEL = logging.DEBUG
|
|
|
|
|
|
# Emote references
|
|
class Emoji(object):
|
|
"""A constants class storing the IDs of various Emojis used by the bot."""
|
|
UPVOTE = 810310002220859393
|
|
DOWNVOTE = 810310019840213002
|
|
|
|
|
|
# Named Tuples
|
|
ReactionMarker = namedtuple("ReactionMarker", ["message", "user", "emoji"], defaults=[Emoji.UPVOTE])
|