This project is a command line tool that interacts with the Discord API using a bot. It allows you to list servers and users in a server, and check for mutual servers between users. The tool is built using the Serenity Rust library in combination with Tokio for asynchronous integration.
- List all servers your bot is in
- Allow the user to select a server
- Retrieve users in the selected server
- Check for mutual servers between users (across multiple servers)
- CLI for ease of use
The bot is written in the Rust Programming Language - so you'll need to have this installed and up-to date!
Bash / Linux:
curl --proto '=https' --tlsv1.2 -sSf https://sh/rustup.rs | shPowershell / Windows:
Invoke-WebRequest -Uri https://sh.rustup.rs -OutFile rustup-init.exe; .\rustup-init.exeBefore running this bot, you need to create a Discord Bot Application in Discord’s Developer Portal and copy your bot token.
Steps:
- Go to Discord Developer Portal
- Click
New Applicaton - Give your bot a name
- In the left sidebar, go to
Botand clickAdd Bot - Under your
Botsettings, clickCopyto get your bots Token. This will be used to authenticate your bot with Discord.
Setting Bot Permissions:
In the OAuth2 section in the left sidebar, generate an invite URL for your bot by selecting:
BotunderScopes- Select
View ChannelsunderBot Permissions - Invite your bot to your server using this URL
Now that your Discord Bot is set up, you can clone this program to your local computer:
Bash / Linux:
git clone https://github.com/emmalt3/discordTool-CLI.gitPowershell / Windows:
git clone https://github.com/emmalt3/discordTool-CLI.gitEnsures we are in the root of the cloned repository
Bash / Linux:
cd discordTool-CLIPowershell / Windows:
cd C:\path\to\discordTool-CLIThe bot requires your Discord Bot Token to run. Store this value in your .env file, in the root of the cloned repository.
Bash / Linux:
echo "DISCORD_TOKEN=replaceWithYourBotToken" > .envPowershell / Windows:
echo "DISCORD_TOKEN=replaceWithYourBotToken" > .envBe sure to replace replaceWithYourBotToken with your Discord Bot Token that you coppied from earlier!
Run these commands in the root of the cloned repository to install the dependancies and compile the project.
Bash / Linux:
cargo buildPowershell / Windows:
cargo buildYou should now be able to run the project from the CLI using the following command.
Bash / Linux:
cargo runPowershell / Windows:
cargo runWhen you run the bot, you will be prompted to select a server from the list of servers that the bot is in. You can input the number corresponding to the server you want to interact with.
When a server has been selected, the bot pulls all members of that server and checks which other servers those members are in. It will then list the members who share mutual servers with others.