Files
contest-assistant/bot/constants.py
Xevion 7427763b57 Implement Submission.update and get/fetch message helper functions
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
2021-02-17 05:18:25 -06:00

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])