This repository is a group project for CSS360. The team is using this repository to set up collaboration tools and infrastructure for a Discord bot project. The specific functionality of the bot is to simulate a card game of Mafia.
- Group repository and individual forks created
- GitHub Projects (Kanban board) set up
- Discord deployment server created
- Discord test servers created
- Project is currently in the planning and setup phase
- Team Name: MOASA
- Members:
- Mini
- Oliver
- Alexandra
- Sari
- Ayad
Sprint 1 focused on setting up a working Discord bot and implementing initial features.
Completed features include:
- Welcome message with a meme when a new user joins the server
- Initial setup for the Mafia game
- Defined Mafia game rules
- /join command for players to join a game
- Direct messages sent to players when enough users have joined
Sprint 2 focused on completing the core Mafia game functionality while improving interactivity, visual feedback, and overall game stability.
Completed features include:
- Implemented a real-time countdown timer during the Night phase
- Implemented a real-time coutdown timer during the voting(mini)
- Added specific image for doctor save person who was killed by mafia and voting(mini)
- Prevented duplicate Night phase images on reset
- Added phase-specific images for Night, Morning, Kill, Win, and Lose states
- Integrated role-specific images into the /role command
This project is part of CSS360 and is under active development. The README will be updated as the project design becomes clearer.
/joinJoin the Mafia game (starts or joins recruitment)/roleView your Mafia role (private)/vote <user>Vote to eliminate a player (Day phase only)/kill <user>Mafia: eliminate a player (Night phase only)/save <user>Doctor: protect a player (Night phase only)/mycommandsList commands for your role/resetReset the Mafia game (admin only)/mafia roleView all roles in the Mafia game/rulesView the rules of the Mafia game/statsShow player stats across all games and recent games
/memeGet a meme
The bot tracks lifetime player stats across matches and stores them persistently in:
- data/stats.json
Recent games are recorded using per-game snapshots so /stats can show what happened in the last matches.
Note:
- The data/ folder is runtime output and should not be committed to git. Add
data/to .gitignore.
Customize and deploy your own welcome memebot for your Discord server!
This template repository has all the code you need, with a preconfigured Codespaces development environment, to send a welcome message along with a meme when a user joins your Discord server.
This template repository requires a .env file to pass variables to your application. The .env file is used to store data that you want to keep private or hidden like API keys or tokens from external services like Discord.
This template repository has a sample .env file, .env-sample, that you can rename to .env or copy and paste the variables in .env-sample into a new .env file.
In your .env file you will find a variable named MEME_URL where you can add a URL to your favorite meme.
In the src directory you will find another directory called events. Open the events directory and you will find the guildMemberAdd.js file. You'll notice that we left helpful comments on where you can update the code to your liking.
To add a welcome message, you can update the getWelcomeMessage function after the content: keyword.
Maybe you want to use an API service to provide random memes or maybe you don't want to share a meme at all. No matter what route you choose, you should take this Discord bot and make it your own. 😃
We recommend creating a new branch anytime you tinker so you don't have to worry about making mistakes on your main branch. Once your new branch is in a good state, you can merge your changes to your main branch using a pull request. 🚀
Maybe you'd like to customize what happens when someone uses the /meme command?
Visit https://discord.com/developers/applications to create a new application on Discord. Once there, click the new application button. After you click on the new application button, you can then create a new application (Note: That we created a new application called Bot Developer):
After creating an application you should see the application under My applications. Open your newly created application by clicking on it.
Select the Bot settings to edit the details. First, click on reset token to generate a new token that you will use in your .env file. Copy the generated token and set the TOKEN variable in your .env file with your newly generated token and the Client ID from the OAuth2 menu (in .env, CLIENT_ID=...).
Select the public bot option if you want your bot to be publically available. Select all the Privileged Gateway Intents like PRESENCE INTENT, SERVER MEMBERS INTENT, MESSAGE CONTENT INTENT if your bot needs those intents.(Note: For this application you'll need all of these intents.)
Open the OAuth2 setting and then select URL Generator.
Select the bot checkbox under SCOPES. After, select Send Messages, Mention Everyone, and Add Reactions.
Once you have set your bot permissions copy the generated url below.
Visit the generated url from the previous step and choose the server that you want to add the bot to. Once you've selected the server click continue.
Once the bot is added it will appear on your Discord server in offline mode.
You can now run the code in the repository using the command line by typing the commands npm run register' followed by npm start`.








