Discord Bot to manage our Film Club.
There are 2 separate scripts:
register_application_commands.py
needs to be run any time the Discord application commands changeslambda_function.py
is run any time an application command is run
There is one DynamoDB table needed by FilmBot called "filmbot-table". It has a partition key called "PK" and a sort key called "SK".
The partition key will be Discord Guild ID.
The sort key will take one of the following forms:
"DISCORDUSER#" + DiscordUserID
"FILM#NOMINATED#" + FilmID
"FILM#WATCHED#" + DateTimeStarted + "." + FilmID
Where:
DiscordUserID
is the user's Discord ID (supplied by Discord)FilmID
is a UUID that we generate per filmDateStarted
is an ISO 8601 formatted string of the UTC datetime that film was started being watched
For example:
"DISCORDUSER#16393729388392"
"FILM#NOMINATED#76988c8a-a15d-48a9-8805-5c7f1723e298"
"FILM#WATCHED#2022-01-19T21:35:58Z.76988c8a-a15d-48a9-8805-5c7f1723e298"
The records with sort key starting with "DISCORDUSER#*"
contains the following
fields:
NominatedFilmID
is a string matching a"FILM#NOMINATED#*"
sort key that represents this users nominated film, orNULL
if this user has no currently nominated filmVoteID
is a string matching a"FILM#NOMINATED#*"
sort key that represents this user's voted film, orNULL
if this user has not voted yet in this roundAttendanceVoteID
is a string matching a"FILM#WATCHED#*.*"
sort key that represents this user's attendance vote for the last watched film, orNULL
if this user did not watch the latest film
WARNING There cannot be any entries that appear alphabetically between DISCORDUSER#
and FILM#NOMINATED
. This is because we would like to get all users and all nominated films in one go in order to display what the current voting situation is.
The records with sort key starting with "FILM.*"
contains the following fields:
FilmName
is a string representation of the film's nameDiscordUserID
is a string matching the users's Discord ID who nominated this filmIMDbID
isNULL
or an IMDB ID (e.g. "0113375")DiscordUserID
is a string matching the users's Discord ID who nominated this filmCastVotes
is a non-negative integer representing the number of votes cast for this filmAttendanceVotes
is a non-negative integer representing the number of attendance votes for the user who nominated this filmUsersAttended
isNULL
for unwatched films or a non-empty set containing the user's Discord IDs of those who have attended (DynamoDB does not support empty string sets)DateNominated
is an ISO 8601 formatting string of the UTC datetime this film was nominated