A discord bot (ReadMe is outdated!)
Here's a list of useful definitions:
Used to define a single game instance.
Running: Boolean
: Checks if a game is currently runningModerator: GuildMember
: The person who starts the game --> Access to empowered commands_Players: Array of GuildMembers
: The people in the gameRoles: Array of Role Names
: The roles added to the gameAssignments: Collection(GuildMember => role.object)
: Assigns players with roles from respective arraysStage: String
: Current stage of game:Setup
,Night
,Processing
,Day
, orTrial
Actions: Array of Arrays of Action{ name: String, agent: GuildMember, receiver: GuildMember}
: Organizes all actions for a single night by priority, resets every new dayCounter: Number
: Counts the number of Night/Day cycles that have gone byCategory: CategoryChannel
: The Discord guild category within which the game resideschat: TextChannel
: The Discord guild text channel where Toggerbot will make announcements as GodOrigin: TextChannel
: The Discord guild text channel where the game was startedReset: Function()
: Used to end a gameCheckNight: Function(Message, action: String, targets: Number)
: Checks if the command can be passed. Parameters: action: the name of the command targets: the number of players the command can target; returns: Array of role.objects of targetsCycleNight: Function()
: Brings the game onward into the next NightProcessNight: Function(menu: String)
: Processes all actions selected by players during Night phase; Parameter: menu: Id of the message with action selection, used to close reaction menu
Base object used to define a player's role
Alive: Boolean
: Tells whether the player is aliveWill: String
: A player's last willVisited: Array of GuildMembers
: The players that visit that nightBlocked: GuildMember
: False if not role-blocked; the player that role-blocked that night
Folder containing files for every role
View
: Object containing display information for the tos!role
and tos!me
commands
- Note: Keep lines short for the
Abilities
property to allow theCommands
property to be in-line
Object
: Extends Game._Player, the object that is ultimately assigned to a player when a game begins
Name: String
Commands: String
: A string that includes all the names of commands that the role can usePriority: Number
: The priority level of the role's night ability Might not be necessary?Attack: Number
: 0-3, None < Basic < Powerful < UnstoppableDefense: Number
: 0-3 , None < Basic < Powerful < InvincibleVisits: Boolean
: States whether the role's ability causes it to visit another player
client.games: Collection(Guild.id => Game) Links every accessible guild with a Town Of Salem game instance
client.prefixes: Collection(folderName => Collection(commandName => command)) Organizes commands by prefix
User.partOfTos: Guild.id False if user is not part of a game