Root-Me Discord bot using Discord.js
and Slash Commands.
built by @kernoeb.
- Add user / Remove user
- Scoreboard with auto update / refresh
- Notifications (new challenge added or succeed, new validation, new solution)
- Search a user or a challenge id
- Information about a challenge or a user
- Chart (leaderboard)
/adduser <id>
: Add a user (id)
/challenge <id_or_name>
: Information about a challenge
/chart
: Leaderboard chart
/createglobalscoreboard
: Create a global scoreboard
/deluser <id>
: Delete a user (id)
/getlastchallenges
: Get the last challenges
/help
: Help
/init
: Initialize the bot in the channel
/ping
: Ping pong
/scoreboard <category>
: Scoreboard (with optional category)
/searchuser <name>
: Search a user by name
/user <id_or_name>
: Information about a user (id or name)
/topctftime <locale>
: CTFTime TOP 10 (global / country)
/nextctf <numberctf>
: Next CTF of week (CTFTime)
/pickctf <id>
: Vote for a specific CTF (CTFTime)
- Docker > 20
- Create a Discord bot and invite it : https://discord.com/api/oauth2/authorize?client_id=xxxx&permissions=2684472384&scope=applications.commands%20bot (replace xxxx with the bot client id)
I'm using Docker version 20.10.x and Docker Compose (not docker-compose)
- Clone the repository, or only download
.env.example
,docker-compose.yml
andupdate.sh
:
mkdir -p ./jean_racine && cd ./jean_racine
curl https://raw.githubusercontent.com/kernoeb/jean_racine_bot/main/update.sh -o update.sh
curl https://raw.githubusercontent.com/kernoeb/jean_racine_bot/main/docker-compose.yml -o docker-compose.yml
curl https://raw.githubusercontent.com/kernoeb/jean_racine_bot/main/.env.example -o .env.example
chmod u+x update.sh
You can also add the Dockerfile if you want to build the image by yourself
- Get an API Key on Root-Me here
- Copy
.env.example
to.env
and replace variables
API_KEY is the main Root-Me API Key (premium is better!).
API_KEY_FIRST can be used to get all non-premium challenges, to avoid a lot of requests on your account
You can use an api key or a cookie
mkdir -p /opt/jeanracine
chown -R 1001 /opt/jeanracine
./update.sh
- Wait for the bot to load all the challenges (it can take a long time)
Please note that registering the slash commands in Discord can take a long time. You can force it by using Routes.applicationGuildCommands, located in the register_slash_commands file
If this does not work -> kernoeb#7737
on Discord, @kernoeb on Telegram :)
You can also add a cron to automatically update the bot (crontab.guru is a good tool)
Something like 0 0 * * * cd /path/to/jeanracine/ && ./update.sh
Add this to your .bashrc
:
function jeanracinelogs() {
if [ $# -eq 0 ]
then
docker logs jean_racine_bot-rootme_node-1 --tail 20 -f
else
docker logs jean_racine_bot-rootme_node-1 --tail $1 -f
fi
}
Open a new terminal, then try jeanracinelogs
.
docker exec -it <name-of-jean-racine-container> register_slash_commands
Global Scoreboard
Notifications
Information about a user
Information about a challenge
Scoreboard with arrows
Last challenges
Charts
Thanks to Antabuse for his help for the CTFTime part of the bot !