From 965ab54f20e1969c5fc9d15a19448668a7120575 Mon Sep 17 00:00:00 2001 From: Adrian Amaglio Date: Sun, 19 Apr 2020 21:07:48 +0200 Subject: [PATCH] working nice --- build.sh | 4 ++++ defaultReactions.json | 4 ++++ index.html | 1 + index.js | 7 ++++--- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 build.sh diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..128ceb2 --- /dev/null +++ b/build.sh @@ -0,0 +1,4 @@ +echo "Ce script ne s’exécute pas, il est là à titre d’exemple" +exit 0 + +docker build . -t jeancloud/educbot:latest -t jeancloud/educbot:1.0.0 -t jeancloud/educbot:1.0 diff --git a/defaultReactions.json b/defaultReactions.json index 7f0c391..64e34c8 100644 --- a/defaultReactions.json +++ b/defaultReactions.json @@ -30,5 +30,9 @@ "dab": { "prefix": ":dab:", "description": "Dab" + }, + "fuck": { + "prefix": "🖕", + "description": "Je vous emmerde!" } } diff --git a/index.html b/index.html index 229313b..90f016c 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,7 @@ + Éduc-Bot, le bot d’éduc-pop
diff --git a/index.js b/index.js index 88d1d00..02b7e3e 100644 --- a/index.js +++ b/index.js @@ -206,7 +206,7 @@ client.on('message', msg => { msg.reply(text) } else if (msg.content === '!educpop-web') { - msg.reply('https://educbot.jean-cloud.net?channel_id=' + msg.channel.id + '&web_token=' + channel.web_token + '&ws_port=' + (process.env.EXT_WS_PORT || process.env.WS_PORT || '8080') + msg.reply('https://educbot.jean-cloud.net?channel_id=' + msg.channel.id + '&web_token=' + channel.web_token + '&ws_port=' + (process.env.EXT_WS_PORT || process.env.WS_PORT || '8080')) } /* save and ignore own messages */ else if(msg.author.username === process.env.BOT_USERNAME){ @@ -217,14 +217,15 @@ client.on('message', msg => { else if(msg.content.startsWith('-')) { const content = msg.content.slice(1) if (content.toLowerCase() in reactions) { - educpopDelPerson(channel, msg.member.nickname, content.toLowerCase()) + //TODO est-ce qu’un nickname vide aura la valeur username ? + educpopDelPerson(channel, msg.member.nickname || msg.member.username, content.toLowerCase()) msg.delete() reply(channel) } } else if (msg.content.toLowerCase() in reactions) { var reaction = msg.content.toLowerCase() - educpopAddPerson(channel, msg.member.nickname, msg.content.toLowerCase()) + educpopAddPerson(channel, msg.author.nickname || msg.author.username, msg.content.toLowerCase()) msg.delete() reply(channel) }