Antidepressant or Tolkien? Command

This commit is contained in:
Dragon Fire
2020-06-09 14:56:04 -04:00
parent 22898caa91
commit 392d80980e
5 changed files with 194 additions and 4 deletions
+4 -1
View File
@@ -226,7 +226,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 469
Total: 470
### Utility:
@@ -494,6 +494,7 @@ Total: 469
* **akinator:** Think about a real or fictional character, I will try to guess who it is.
* **anagramica:** Try to find all the anagrams for a given set of letters.
* **antidepressant-or-tolkien:** See if you can guess if a word is an Antidepressant or Tolkien character.
* **blackjack:** Play a game of blackjack.
* **box-choosing:** Do you believe that there are choices in life? Taken from Higurashi Chapter 4.
* **bubble-wrap:** Pop some bubble wrap.
@@ -823,6 +824,8 @@ here.
* anime-airing ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
* anime-character ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
* manga ([API](https://anilist.gitbook.io/anilist-apiv2-docs/))
- [Antidepressants or Tolkien](https://antidepressantsortolkien.now.sh/)
* antidepressant-or-tolkien (Question Data)
- [Antonio Guillem](http://antonioguillem.com/)
* distracted-boyfriend ([Image](https://www.istockphoto.com/photo/gm493656728-77018851))
- [Apple](https://www.apple.com/)
+122
View File
@@ -0,0 +1,122 @@
[
{
"name": "Bilbo",
"type": "tolkien",
"text": "Easy one! Bilbo Baggins was a Hobbit of the Shire, the main protagonist of The Hobbit."
},
{
"name": "Azafen",
"type": "drug",
"text": "Approved in Russia for the treatment of depression introduced in the late 1960s and is still used today."
},
{
"name": "Bergil",
"type": "tolkien",
"text": "Bergil was born around T.A. 3009, was the eldest son of Beregond of Gondor. He accompanied Pippin Took when he first arrived in the city of Minas Tirith"
},
{
"name": "Celebrían",
"type": "tolkien",
"text": "Elf-lady of Lothlórien, the daughter of Celeborn and Galadriel. As the wife of Elrond, she was also known as Lady of Rivendell"
},
{
"name": "Círdan",
"type": "tolkien",
"text": "He was a Sindarin Elf, one of the wisest and most foresighted of the Elves, and by the Second Age the oldest known elf in Middle-earth. He was the bearer of the Great Ring Narya, which he in turn gave to Gandalf"
},
{
"name": "Clédial",
"type": "drug",
"text": "Medifoxamine, previously sold under the brand names Clédial and Gerdaxyl, is an atypical antidepressant with additional anxiolytic properties acting via dopaminergic and serotonergic mechanisms which was formerly marketed in France and Spain, as well as Morocco"
},
{
"name": "Desyrel",
"type": "drug",
"text": "Sold under many brand names, it is used to treat major depressive disorder, anxiety disorders, and, with other medications, alcohol dependence. It is taken by mouth. Common side-effects include dry mouth, feeling faint, vomiting, and headache."
},
{
"name": "Edronax",
"type": "drug",
"text": "Reboxetine, sold under the brand name Edronax among others, is a drug of the norepinephrine reuptake inhibitor class, marketed as an antidepressant for use in the treatment of major depression."
},
{
"name": "Elendil",
"type": "tolkien",
"text": "Elendil was also known as Elendil the Tall (being the tallest of Men who escaped the Downfall) and also known as Elendil the Fair."
},
{
"name": "Elronon",
"type": "drug",
"text": "Noxiptiline (brand names Agedal, Elronon, Nogedal), also known as noxiptyline and dibenzoxine, is a tricyclic antidepressant (TCA) that was introduced in Europe in the 1970s for the treatment of depression."
},
{
"name": "Erestor",
"type": "tolkien",
"text": "He was the chief counsellor of Elrond's household at the time of the War of the Ring; as such, he took part in the Council of Elrond. He did not support the idea of destroying The Ring, and preferred to guarding it from Sauron"
},
{
"name": "Eskalith",
"type": "drug",
"text": "Also knows as Lithium carbonate. This medication is used to treat manic-depressive disorder (bipolar disorder)."
},
{
"name": "Finarfin",
"type": "tolkien",
"text": "Finarfin was the youngest child and son of Finwë and Indis. After the Flight of the Noldor he remained in Tirion and ruled the Noldor who remained in Aman."
},
{
"name": "Haldir",
"type": "tolkien",
"text": "He was an Elf of Lothlórien, probably a Silvan Elf, and a marchwarden who guarded the forest's northern borders. When the Fellowship of the Ring arrived in Lórien, he became their guide to Caras Galadhon."
},
{
"name": "Minalcar",
"type": "tolkien",
"text": "Rómendacil II born Minalcar, was the nineteenth King of Gondor. "
},
{
"name": "Nardil",
"type": "drug",
"text": "Phenelzine (Nardil, Nardelzine) is a non-selective and irreversible monoamine oxidase inhibitor of the hydrazine class which is used as an antidepressant and anxiolytic."
},
{
"name": "Narmacil",
"type": "tolkien",
"text": "Narmacil I was the seventeenth King of Gondor after the death of his father Atanatar II. Narmacil II was the twenty-ninth King of Gondor and the son of Telumehtar."
},
{
"name": "Narvi",
"type": "tolkien",
"text": "He was a dwarf of Khazad-dûm (Moria) during the Second Age. He made the mighty Doors of Durin that guarded the West-gate of the Dwarven city."
},
{
"name": "Orophin",
"type": "tolkien",
"text": "He was one of three wardens of the northern border of Lothlórien met by the Fellowship as they entered the Golden Wood."
},
{
"name": "Sintamil",
"type": "drug",
"text": "Nitroxazepine (brand name Sintamil) is a tricyclic antidepressant (TCA) which was introduced by Ciba-Geigy (now Novartis) for the treatment of depression in India in 1982."
},
{
"name": "Luvox",
"type": "drug",
"text": "Fluvoxamine, sold under the brand name Luvox among others, is an antidepressant of the selective serotonin reuptake inhibitor (SSRI) class which is used primarily for the treatment of obsessivecompulsive disorder (OCD)."
},
{
"name": "Sildenafil",
"type": "drug",
"text": "Sildenafil, sold as the brand name Viagra among others, is a medication used to treat erectile dysfunction and pulmonary arterial hypertension. It is unclear if it is effective for treating sexual dysfunction in women)."
},
{
"name": "Cymbalta",
"type": "drug",
"text": "Duloxetine, sold under the brand name Cymbalta among others, is a medication used to treat major depressive disorder, generalized anxiety disorder, fibromyalgia, and neuropathic pain. It is taken by mouth"
},
{
"name": "Amantadine",
"type": "drug",
"text": "Amantadine (trade name Symmetrel, by Endo Pharmaceuticals) is a medication that has U.S. Food and Drug Administration approval for use both as an antiviral and an antiparkinsonian medication."
}
]
@@ -0,0 +1,65 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
const questions = require('../../assets/json/antidepressant-or-tolkien');
const answers = {
drug: 'an Antidepressant',
tolkien: 'a Tolkien character'
};
const tolkienResponses = ['tolkien', 't'];
const drugResponses = ['drug', 'antidepressant', 'anti-depressant', 'd', 'a', 'ad'];
module.exports = class AntidepressantOrTolkienCommand extends Command {
constructor(client) {
super(client, {
name: 'antidepressant-or-tolkien',
aliases: ['antidepressant-tolkien', 'drug-or-tolkien', 'drug-tolkien'],
group: 'games-sp',
memberName: 'antidepressant-or-tokien',
description: 'See if you can guess if a word is an Antidepressant or Tolkien character.',
credit: [
{
name: 'Antidepressants or Tolkien',
url: 'https://antidepressantsortolkien.now.sh/',
reason: 'Question Data'
}
]
});
}
async run(msg) {
const question = questions[Math.floor(Math.random() * questions.length)];
await msg.reply(stripIndents`
**You have 10 seconds, is this an Antidepressant or a Tolkien character?**
${question.name}
`);
const filter = res => {
if (res.author.id !== msg.author.id) return false;
const choice = res.content.toLowerCase();
if (drugResponses.includes(choice) || tolkienResponses.includes(choice)) return true;
return false;
};
const msgs = await msg.channel.awaitMessages(filter, {
max: 1,
time: 15000
});
if (!msgs.size) {
return msg.reply(stripIndents`
Time\'s up! It was **${answers[question.type]}**!
_${question.text}_
`);
}
const choice = msgs.first().content.toLowerCase();
const correct = (question.type === 'tolkien' && tolkienResponses.includes(choice))
|| (question.type === 'drug' && drugResponses.includes(choice));
if (!correct) {
return msg.reply(stripIndents`
Oh no! It was **${answers[question.type]}**!
_${question.text}_
`);
}
return msg.reply(stripIndents`
Correct! It was **${answers[question.type]}**!
_${question.text}_
`);
}
};
+2 -2
View File
@@ -24,9 +24,9 @@ module.exports = class AiFoodCommand extends Command {
try {
const { text } = await request.get('https://thissnackdoesnotexist.com/');
const $ = cheerio.load(text);
const img = $('div[class="Absolute-Center"]').first().attr('style').match(/background-image:url\((.+)\);/i)[1];
const img = $('div[class="Absolute-Center"]').first().attr('style').match(/background-image:url\((.+)\);/i);
const name = $('h1[class="snack-description"]').first().text();
return msg.say(`AI-Generated Food: ${name}`, { files: [{ attachment: img, name: 'ai-food.jpg' }] });
return msg.say(`AI-Generated Food: ${name}`, img ? { files: [{ attachment: img, name: 'ai-food.jpg' }] } : {});
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "116.12.0",
"version": "116.13.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {