From aca7b34580c2c56e41e03b8804e768f6f7de1627 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 17:52:12 -0500 Subject: [PATCH 1/8] update abbreviation_key.json --- abbreviation_key.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abbreviation_key.json b/abbreviation_key.json index fd2b4be..e56daed 100644 --- a/abbreviation_key.json +++ b/abbreviation_key.json @@ -1 +1 @@ -{"target_phrases":{"idk":"I don't know","hoco":"homecoming","bbl":"be back later","bbg":"baby girl","mb":"my bad","mfw":"my face when","tfw":"that face when","ebr":"East Baton Rouge","ttyl":"talk to you later","ab":"about","abt":"about","dk":"don't know","prolly":"probably","tbh":"to be honest","smh":"shaking my head","btw":"by the way","ngl":"not gonna lie","fr":"for real","yessss":"yes","bc":"because","u":"you","thru":"through","lmao":"laughing my ass off","tldr":"too long; didn't read","ofc":"of course","linux":"GNU/Linux","xfl":"Extreme Football League","bi":"bisexual","abbr":"abbreviation","jk":"just kidding","gm":"good morning","mc":"Minecraft","nfl":"National Football League","ygd":"you're gonna die","gn":"goodnight","gac":"Great American Cookie","ncaa":"National Collegiate Athletic Association","em":"them","tbf":"to be fair","ppl":"people","bb":"baby","stfu":"shut the frick up","nvm":"nevermind","idc":"I don't care","dc":"don't care","ty":"thank you","yw":"you're welcome","lol":"laughing out loud","ok":"okay","sout":"System.out.println(\"\");","serr":"System.err.println(\"\");","psvm":"public static void main(String[] args) { }","rn":"right now","osjhs":"I made it up","trans":"transgender","js":"JavaScript"}} \ No newline at end of file +{"target_phrases":{"idk":"I don't know","hoco":"homecoming","bbl":"be back later","bbg":"baby girl","mb":"my bad","mfw":"my face when","tfw":"that face when","ebr":"East Baton Rouge","ttyl":"talk to you later","ab":"about","abt":"about","dk":"don't know","prolly":"probably","tbh":"to be honest","smh":"shaking my head","btw":"by the way","ngl":"not gonna lie","fr":"for real","yessss":"yes","bc":"because","u":"you","thru":"through","lmao":"laughing my ass off","tldr":"too long; didn't read","ofc":"of course","linux":"GNU/Linux","xfl":"Extreme Football League","bi":"bisexual","abbr":"abbreviation","jk":"just kidding","gm":"good morning","mc":"Minecraft","nfl":"National Football League","ygd":"you're gonna die","gn":"goodnight","gac":"Great American Cookie","ncaa":"National Collegiate Athletic Association","em":"them","tbf":"to be fair","ppl":"people","bb":"baby","stfu":"shut the frick up","nvm":"nevermind","idc":"I don't care","dc":"don't care","ty":"thank you","yw":"you're welcome","lol":"laughing out loud","ok":"okay","sout":"System.out.println(\"\");","serr":"System.err.println(\"\");","psvm":"public static void main(String[] args) { }","rn":"right now","osjhs":"I made it up","trans":"transgender","js":"JavaScript","gc":"group chat","vc":"voice chat"}} \ No newline at end of file From 7b0806f01843280579bcf661c175065ef73dcfe3 Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 17:53:14 -0500 Subject: [PATCH 2/8] Add countChars function --- abbreviation_key.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/abbreviation_key.json b/abbreviation_key.json index e56daed..e3c877f 100644 --- a/abbreviation_key.json +++ b/abbreviation_key.json @@ -1 +1 @@ -{"target_phrases":{"idk":"I don't know","hoco":"homecoming","bbl":"be back later","bbg":"baby girl","mb":"my bad","mfw":"my face when","tfw":"that face when","ebr":"East Baton Rouge","ttyl":"talk to you later","ab":"about","abt":"about","dk":"don't know","prolly":"probably","tbh":"to be honest","smh":"shaking my head","btw":"by the way","ngl":"not gonna lie","fr":"for real","yessss":"yes","bc":"because","u":"you","thru":"through","lmao":"laughing my ass off","tldr":"too long; didn't read","ofc":"of course","linux":"GNU/Linux","xfl":"Extreme Football League","bi":"bisexual","abbr":"abbreviation","jk":"just kidding","gm":"good morning","mc":"Minecraft","nfl":"National Football League","ygd":"you're gonna die","gn":"goodnight","gac":"Great American Cookie","ncaa":"National Collegiate Athletic Association","em":"them","tbf":"to be fair","ppl":"people","bb":"baby","stfu":"shut the frick up","nvm":"nevermind","idc":"I don't care","dc":"don't care","ty":"thank you","yw":"you're welcome","lol":"laughing out loud","ok":"okay","sout":"System.out.println(\"\");","serr":"System.err.println(\"\");","psvm":"public static void main(String[] args) { }","rn":"right now","osjhs":"I made it up","trans":"transgender","js":"JavaScript","gc":"group chat","vc":"voice chat"}} \ No newline at end of file +{"target_phrases":{"idk":"I don't know","hoco":"homecoming","bbl":"be back later","bbg":"baby girl","mb":"my bad","mfw":"my face when","tfw":"that face when","ebr":"East Baton Rouge","ttyl":"talk to you later","abt":"about","ab":"about","dk":"don't know","prolly":"probably","tbh":"to be honest","smh":"shaking my head","btw":"by the way","ngl":"not gonna lie","fr":"for real","yessss":"yes","bc":"because","u":"you","thru":"through","lmao":"laughing my ass off","tldr":"too long; didn't read","ofc":"of course","linux":"GNU/Linux","xfl":"Extreme Football League","bi":"bisexual","abbr":"abbreviation","jk":"just kidding","gm":"good morning","mc":"Minecraft","nfl":"National Football League","ygd":"you're gonna die","gn":"goodnight","gac":"Great American Cookie","ncaa":"National Collegiate Athletic Association","em":"them","tbf":"to be fair","ppl":"people","bb":"baby","stfu":"shut the frick up","nvm":"nevermind","idc":"I don't care","dc":"don't care","ty":"thank you","yw":"you're welcome","lol":"laughing out loud","ok":"okay","sout":"System.out.println(\"\");","serr":"System.err.println(\"\");","psvm":"public static void main(String[] args) { }","rn":"right now","osjhs":"I made it up","trans":"transgender","js":"JavaScript","gc":"group chat","vc":"voice chat"}} \ No newline at end of file From 7827d1e63af07ed171c58da57d5d5672a875331e Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 18:01:12 -0500 Subject: [PATCH 3/8] That if statement needs to be before its usage in replyString --- main.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.ts b/main.ts index aec0d36..1eed445 100644 --- a/main.ts +++ b/main.ts @@ -94,13 +94,14 @@ function matchAbbr(abbrTarget) { function replyMessage(message, correctedMessage, abbrsUsed) { var plural = ""; - var replyString = "Your message contains " + plural + "! Let me fix that for you: \n > " + correctedMessage + "\n \n \|\|btw I was written by Caleb Fontenot\|\|" - var stringLength = replyString.length; if (abbrsUsed == 1) { plural = "an acronym"; } else { plural = abbrsUsed + " acronyms" } + var replyString = "Your message contains " + plural + "! Let me fix that for you: \n > " + correctedMessage + "\n \n \|\|btw I was written by Caleb Fontenot\|\|" + var stringLength = replyString.length; + if (stringLength > 2000) { replyString = "Sorry, I detected " + plural + ", but the resultant response was " + stringLength + " characters long, and Discord only allows a maximum of 2000." } From 9cad0cbe1b8f0ba1c0b5b09fa76d5676a631803b Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 19:40:35 -0500 Subject: [PATCH 4/8] Update 'README.md' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 375dc68..ba004a1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a bot that identifies abbreviations in a sentence and replaces them with Example:
![Example](images/example.png)
-To run an instance of this bot, define your bot ID in key.json, then run: +To run an instance of this bot, define your bot ID, guildID (Server ID), and client ID in key.json, then run:
`npm install discord.js`
From f85725d59baf4edfdabb09cb28ba8b0dcecc31ac Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 19:41:15 -0500 Subject: [PATCH 5/8] Update 'README.md' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ba004a1..07affd5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a bot that identifies abbreviations in a sentence and replaces them with Example:
![Example](images/example.png)
-To run an instance of this bot, define your bot ID, guildID (Server ID), and client ID in key.json, then run: +To run an instance of this bot, define your bot token, guildId (Server ID), and client ID in key.json, then run:
`npm install discord.js`
From 5cc801bc35046320cd770d1c2f30e84a7e0d462c Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 19:41:51 -0500 Subject: [PATCH 6/8] Add 'key_template.json' --- key_template.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 key_template.json diff --git a/key_template.json b/key_template.json new file mode 100644 index 0000000..75d2418 --- /dev/null +++ b/key_template.json @@ -0,0 +1,5 @@ +{ + "token": "", + "clientId": "", + "guildId": "" +} \ No newline at end of file From 2a45104c3875016d92253294d03d1be7ec19093f Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 19:56:47 -0500 Subject: [PATCH 7/8] add funny --- .gitignore | 2 +- main.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 518ac03..9e97eae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,3 @@ -key.json +./key.json /nbproject/private/ node_modules/ \ No newline at end of file diff --git a/main.ts b/main.ts index 1eed445..90e1e78 100644 --- a/main.ts +++ b/main.ts @@ -120,6 +120,9 @@ client.on('messageUpdate', (undefined, newMessage) => { }); function checkMessage(message) { + if (message.contains == "<@1091120267851485215>, what are your pronouns?") { + message.reply({content: "My pronouns are she/her ☺️", allowedMentions: { repliedUser: false }}) + } console.log(`${message.author.tag} in #${message.channel.name} sent: ${message.content}`); //console.log(message.author); if (message.author.id == "1091120267851485215") { From 9cec9c0c9f927b6170240a406d241f15ac2bfa8c Mon Sep 17 00:00:00 2001 From: Caleb Fontenot Date: Tue, 4 Apr 2023 19:58:02 -0500 Subject: [PATCH 8/8] add funny --- main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.ts b/main.ts index 90e1e78..7426e34 100644 --- a/main.ts +++ b/main.ts @@ -120,7 +120,7 @@ client.on('messageUpdate', (undefined, newMessage) => { }); function checkMessage(message) { - if (message.contains == "<@1091120267851485215>, what are your pronouns?") { + if (message.content == "<@1091120267851485215>, what are your pronouns?") { message.reply({content: "My pronouns are she/her ☺️", allowedMentions: { repliedUser: false }}) } console.log(`${message.author.tag} in #${message.channel.name} sent: ${message.content}`);