Compare commits

..

No commits in common. "f364e545cd508ed51144a016319507a2a768c436" and "9b1c89854e37b96ce8d64ef1d07d990209a941a2" have entirely different histories.

2 changed files with 13 additions and 25 deletions

View File

@ -2,8 +2,12 @@
This bot allows you to automatically assign the top1/top10/top50 roles on the 42CTF Discord server.
To use it you just have to create the docker container :
```
docker build -t discord_bot .
```
Create an `env_file` file containing :
Create an `env.list` file containing :
```
DISCORD_TOKEN=<token_discord>
AUTH_TOKEN=<api_42CTF_token>
@ -11,5 +15,5 @@ AUTH_TOKEN=<api_42CTF_token>
And then run it with :
```
docker-compose up -d
docker run -d --env-file env.list --name discord_bot
```

View File

@ -15,7 +15,7 @@ async function get_guildID()
async function remove_notlogged(){
let guild = CLIENT.guilds.resolve(await get_guildID());
let token = O_TOKEN;
let url = `https://www.42ctf.local/api/bot/discord?token=${token}`;
let url = `https://www.42ctf.org/api/bot/discord?token=${token}`;
await (guild.members.fetch()).then(() => {
console.log("Cache reloaded !");
@ -27,15 +27,7 @@ async function remove_notlogged(){
['top50', guild.roles.cache.get("803729539145924649")]
]);
const options = {
path: '/',
method: 'GET',
rejectUnauthorized: false,
requestCert: true,
agent: false
};
https.get(url, options, (res) => {
https.get(url,(res) => {
let body = "";
res.on("data", (chunk) => {
@ -73,7 +65,7 @@ async function remove_notlogged(){
}
async function rank(token = O_TOKEN){
let url = `https://www.42ctf.local/api/bot/discord?token=${token}`;
let url = `https://www.42ctf.org/api/bot/discord?token=${token}`;
let guild = CLIENT.guilds.resolve(await get_guildID());
const rolesCollection = new Map([
@ -82,15 +74,7 @@ async function rank(token = O_TOKEN){
['top50', guild.roles.cache.get("803729539145924649")]
]);
const options = {
path: '/',
method: 'GET',
rejectUnauthorized: false,
requestCert: true,
agent: false
};
https.get(url,options,(res) => {
https.get(url,(res) => {
var body = "";
res.on("data", (chunk) => {