Skip to content

❓ Guess who's the message author, bring life to your discord server!

License

Notifications You must be signed in to change notification settings

Pexilo/Whos-That

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Guess who's the message author! Bring life to small communities.

Quality Gate Status wakatime

❓ About Who's That

Who's That was born from my desire to infuse my primary Discord hangout server with fun and interactivity. In a server filled with quirky and occasionally borderlines convos, I had the idea of adding a guessing game element to spice things up.
So, over the course of a weekend, I brought this concept to life.
This particular bot is just one of the many Discord bots I've created. I believe that sharing it would please some people servers, so here you go!

✨ What's the bot doin

Thank you GPT-3 for the cringy demo messages 🫠

1️⃣ Picker Channel

Pick carefully the best message 😎

When typing /whosthat you will be prompt with 1 to 10 random messages.
You can pick your desired message with the corresponding button, or reload messages with the 🔁 button.
Author is not visible so you can also play the game. 😎
The picked message will be sent to the Who's That channel.

2️⃣ Who's That message preview

Let your friends guess who's behind the (cringy) message 🕵️

The picked message will then appear in the Who's That channel. #BossBattleConquered 👍😃

3️⃣ Leaderboard

Challenge your friends 🏆

Leaderboard will show total points, correct answers, position.
Point rules:
+1 point for participating
+1 point for correctly guessing
This is subject to change.

Make sure to /setup your server first 🥶

In depth /setup explanation & tips.

Target: channel where to fetch messages from.
Picker: channel where to pick message from.
Who's That: channel where to send message to.

Make sure to lock the Who's That channel to make it view only to keep it clean,
and make the Picker channel private.

After setting up the channels, you will be prompt to pick users 👥

Picking users will filter the messages to only show the selected users messages.
Select as many users as you want.

You can change the users list with /users command at any time.

You're all set! 🎉
You can begin with /whosthat command.

More in depth explanation 🤓

📥 Fetching messages

Target channel will fetch message Ids called "checkpoints" (each 100 messages) to avoid fetching all messages at once.
For example, if you have 1000 messages in your target channel, the bot will fetch 10 checkpoints (100 messages each) and add them to a list.
From my experience, fetching 100 000 messages takes roughly 15–20 minutes.

When you request Who's That messages to pick, the bot will randomly pick 2 checkpoints from the list, and fetch 100 messages from the checkpoint.
Then, the bot will randomly pick 5 messages from each checkpoint, and send them to the picker channel. Take note that the bot will filter messages along the process.

📝 Message filtering

The bot will filter messages that are too short, that contains a link, attachment, embed, contains only an emoji or a discord mention. And obviously, only messages that are from picked users.

🎮 The game & leaderboard

When you pick a message, the bot will send it to the Who's That channel.
This sent message will contain a select with 5 choices (4 random users and the author).

When you pick a user, the bot will check if the user is the correct one.
Check above rules for points attribution.

The leaderboard is accessible on each Who's That message with a button or with /leaderboard command.
The leaderboard will show 10 players per page.

Because of the fetching system of the bot that request a lot of API calls, I will not provide a public version of the bot. Watch out for large channel fetchs that can cause your application to be banned (I didn't tried fetching more than 200k messages).

🌎 Supported Languages

• ☕ English᲼᲼᲼᲼᲼᲼᲼• 🥖 French

yes yes oui oui

Feel free to report any bad translations, bugs, features requests...

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

📝 License

MIT License Copyright (c) 2023 Pexilo

👏 Show your support

Simply give me a ⭐️ to support me! 😄

⚙️ Installation

Requirements

  • 📃 Node.js 16.9 or higher
  • 🍃 MongoDB cluster
  • 🤖 Discord Bot

MongoDB:

  1. Create an account
  2. Create a cluster
  3. Connect it with "connect your application"
  4. Copy your connection string
  5. Replace <password> with your database access user password
  6. Keep it for later use

Your bot:

  1. Log in to your Discord account on the Discord Developer Portal website (Discord Developer Portal).
  2. Click the "New Application" button to create a new application.
  3. Give your application a name and click "Create."
  4. In the left panel, click on "Bot" in the menu.
  5. Click the "Add Bot" button.
  6. Under the "Token" section, click "Copy" to copy the bot's token. Use "Reset" if you can't copy it right away.
  7. Keep your token and client ID for later use
  8. Under the "Privileged Gateway Intents" section, enable "Servers Members" & "Message Content" intents.

💫 Quick start

  • Clone the repo
git clone https://github.com/Pexilo/Whos-That
🤖 BOT INVITE
  1. Finish the above steps
  2. Replace <clientId> with your bot ID / client ID

https://discord.com/api/oauth2/authorize?client_id=<clientId>&permissions=117760&scope=applications.commands%20bot

  1. Invite your bot with the above link to your server
🧾 ENV FILE
  1. Replace content of example.env
DISCORD_TOKEN=your-bot-token
MONGO_URI=your-mongo-db-connection-string
  1. Rename the file example.env > .env
📜 CONFIG

src/config.ts

Edit commented lines

import * as dotenv from "dotenv";
dotenv.config();

export default {
  DISCORD_TOKEN: process.env.DISCORD_TOKEN,
  MONGO_URI: process.env.MONGO_URI,
  SLASH_COMMANDS_IDS: {
    users: "1118657612783812622", //Edit this Id with your command Id
    setup: "1118657612783812621", //Also here
    whosthat: "1119193500429336669", //And here
  },
};

But how ? 🥴

On the bot Discord server:
server settings > integrations > select Who's That bot

Commands-Ids

🚀 LAUNCH BOT

  1. Install dependencies
npm i
  1. Start the bot
npm run start

🦾 Powered by

And much more like @napi-rs/canvas, Discord Avatar Maker for message previews.