From 54b402d6e7aeca372818cbca6b61f268753b8eeb Mon Sep 17 00:00:00 2001 From: LunaUrsa <1836049+LunaUrsa@users.noreply.github.com> Date: Sun, 25 Feb 2024 20:35:29 -0600 Subject: [PATCH] Add Calc MDMA --- assets/data/combinedDB.json | 239 +++++----------------- assets/data/psychonautDB.json | 179 +--------------- src/discord/commands/global/d.calcMDMA.ts | 57 ++++++ src/global/commands/g.calcMDMA.ts | 20 ++ 4 files changed, 125 insertions(+), 370 deletions(-) create mode 100644 src/discord/commands/global/d.calcMDMA.ts create mode 100644 src/global/commands/g.calcMDMA.ts diff --git a/assets/data/combinedDB.json b/assets/data/combinedDB.json index dfc6447b7..7a82b38c4 100644 --- a/assets/data/combinedDB.json +++ b/assets/data/combinedDB.json @@ -21336,62 +21336,6 @@ ] } }, - { - "url": "https://psychonautwiki.org/wiki/DMXE", - "name": "DMXE", - "toxicity": [ - "exact toxic dosage is unknown" - ], - "roas": [ - { - "name": "Insufflated", - "dosage": [ - { - "name": "Threshold", - "value": "5 mg" - }, - { - "name": "Light", - "value": "5-20 mg" - }, - { - "name": "Common", - "value": "20-35 mg" - }, - { - "name": "Strong", - "value": "35-60 mg" - }, - { - "name": "Heavy", - "value": "60 mg" - } - ], - "duration": [ - { - "name": "Comeup", - "value": "30-90 minutes" - }, - { - "name": "Onset", - "value": "5-15 minutes" - }, - { - "name": "Peak", - "value": "1-3 hours" - }, - { - "name": "Offset", - "value": "1-2 hours" - }, - { - "name": "Total", - "value": "2-6 hours" - } - ] - } - ] - }, { "url": "https://psychonautwiki.org/wiki/DOB", "name": "DOB", @@ -28284,142 +28228,6 @@ } ] }, - { - "url": "https://psychonautwiki.org/wiki/Glaucine", - "name": "Glaucine", - "summary": "An alkaloid that is found in several different scpecies in the Papaveraceae family. It has antiinflammatory and antitussive effects. Can also be referred to as Yellow Horned Poppy.", - "roas": [ - { - "name": "Oral", - "dosage": [ - { - "name": "Threshold", - "value": "20 mg" - }, - { - "name": "Light", - "value": "20-75 mg" - }, - { - "name": "Common", - "value": "75-150 mg" - }, - { - "name": "Strong", - "value": "150-180 mg" - }, - { - "name": "Heavy", - "value": "180 mg" - } - ], - "duration": [ - { - "name": "Comeup", - "value": "30-60 minutes" - }, - { - "name": "Onset", - "value": "20-45 minutes" - }, - { - "name": "Peak", - "value": "1-3 hours" - }, - { - "name": "Offset", - "value": "1-2 hours" - }, - { - "name": "Afterglow", - "value": "3-8 hours" - }, - { - "name": "Total", - "value": "3-6 hours" - }, - { - "name": "Duration", - "value": "6-8 hours" - }, - { - "name": "After Effects", - "value": "1-8 hours" - } - ], - "bioavailability": "%" - }, - { - "name": "Oral", - "dosage": [ - { - "name": "Threshold", - "value": "20 mg" - }, - { - "name": "Light", - "value": "20-75 mg" - }, - { - "name": "Common", - "value": "75-150 mg" - }, - { - "name": "Strong", - "value": "150-180 mg" - }, - { - "name": "Heavy", - "value": "180 mg" - } - ], - "duration": [ - { - "name": "Comeup", - "value": "30-60 minutes" - }, - { - "name": "Onset", - "value": "20-45 minutes" - }, - { - "name": "Peak", - "value": "1-3 hours" - }, - { - "name": "Offset", - "value": "1-2 hours" - }, - { - "name": "Afterglow", - "value": "3-8 hours" - }, - { - "name": "Total", - "value": "3-6 hours" - }, - { - "name": "Duration", - "value": "6-8 hours" - }, - { - "name": "After Effects", - "value": "1-8 hours" - } - ], - "bioavailability": "%" - } - ], - "classes": { - "psychoactive": [ - "Depressant", - "Habit Forming", - "Opioid", - "Tentative" - ], - "chemical": [] - } - }, { "url": "https://psychonautwiki.org/wiki/HXE", "name": "HXE", @@ -57410,6 +57218,53 @@ } ] }, + { + "name": "glaucine", + "url": "https://wiki.tripsit.me/wiki/glaucine", + "summary": "An alkaloid that is found in several different scpecies in the Papaveraceae family. It has antiinflammatory and antitussive effects. Can also be referred to as Yellow Horned Poppy.", + "classes": { + "psychoactive": [ + "Depressant", + "Habit Forming", + "Opioid", + "Tentative" + ], + "chemical": [] + }, + "roas": [ + { + "name": "Oral", + "dosage": [ + { + "name": "Light", + "value": "50-100 mg" + }, + { + "name": "Common", + "value": "100-150 mg" + }, + { + "name": "Strong", + "value": "150-200 mg" + } + ], + "duration": [ + { + "name": "Onset", + "value": "45-90 minutes" + }, + { + "name": "Duration", + "value": "6-8 hours" + }, + { + "name": "After Effects", + "value": "1-8 hours" + } + ] + } + ] + }, { "name": "glutethimide", "url": "https://wiki.tripsit.me/wiki/glutethimide", diff --git a/assets/data/psychonautDB.json b/assets/data/psychonautDB.json index 6ad2ec525..4700591ea 100644 --- a/assets/data/psychonautDB.json +++ b/assets/data/psychonautDB.json @@ -11524,10 +11524,7 @@ "name": "PCP" }, { - "name": "ALDH2 inhibitors" - }, - { - "name": "Hepatotoxic drugs" + "name": "Antibiotics" } ], "dangerousInteractions": [ @@ -16103,90 +16100,6 @@ } } }, - { - "url": "https://psychonautwiki.org/wiki/DMXE", - "name": "DMXE", - "summary": "", - "addictionPotential": null, - "toxicity": [ - "exact toxic dosage is unknown" - ], - "crossTolerances": null, - "commonNames": null, - "class": { - "chemical": [ - "Arylcyclohexylamines" - ], - "psychoactive": [ - "Dissociatives" - ] - }, - "tolerance": null, - "uncertainInteractions": null, - "unsafeInteractions": null, - "dangerousInteractions": null, - "roa": { - "oral": null, - "sublingual": null, - "buccal": null, - "insufflated": { - "name": "insufflated", - "dose": { - "units": "mg", - "threshold": 5, - "heavy": 60, - "common": { - "min": 20, - "max": 35 - }, - "light": { - "min": 5, - "max": 20 - }, - "strong": { - "min": 35, - "max": 60 - } - }, - "duration": { - "afterglow": null, - "comeup": { - "min": 30, - "max": 90, - "units": "minutes" - }, - "duration": null, - "offset": { - "min": 1, - "max": 2, - "units": "hours" - }, - "onset": { - "min": 5, - "max": 15, - "units": "minutes" - }, - "peak": { - "min": 1, - "max": 3, - "units": "hours" - }, - "total": { - "min": 2, - "max": 6, - "units": "hours" - } - }, - "bioavailability": null - }, - "rectal": null, - "transdermal": null, - "subcutaneous": null, - "intramuscular": null, - "intravenous": null, - "smoked": null - } - }, { "url": "https://psychonautwiki.org/wiki/DOB", "name": "DOB", @@ -21388,96 +21301,6 @@ "smoked": null } }, - { - "url": "https://psychonautwiki.org/wiki/Glaucine", - "name": "Glaucine", - "summary": "", - "addictionPotential": null, - "toxicity": null, - "crossTolerances": null, - "commonNames": null, - "class": { - "chemical": [ - "Aporphine" - ], - "psychoactive": [ - "Psychedelic", - "Depressant" - ] - }, - "tolerance": null, - "uncertainInteractions": null, - "unsafeInteractions": null, - "dangerousInteractions": null, - "roa": { - "oral": { - "name": "oral", - "dose": { - "units": "mg", - "threshold": 20, - "heavy": 180, - "common": { - "min": 75, - "max": 150 - }, - "light": { - "min": 20, - "max": 75 - }, - "strong": { - "min": 150, - "max": 180 - } - }, - "duration": { - "afterglow": { - "min": 3, - "max": 8, - "units": "hours" - }, - "comeup": { - "min": 30, - "max": 60, - "units": "minutes" - }, - "duration": null, - "offset": { - "min": 1, - "max": 2, - "units": "hours" - }, - "onset": { - "min": 20, - "max": 45, - "units": "minutes" - }, - "peak": { - "min": 1, - "max": 3, - "units": "hours" - }, - "total": { - "min": 3, - "max": 6, - "units": "hours" - } - }, - "bioavailability": { - "min": 17, - "max": null - } - }, - "sublingual": null, - "buccal": null, - "insufflated": null, - "rectal": null, - "transdermal": null, - "subcutaneous": null, - "intramuscular": null, - "intravenous": null, - "smoked": null - } - }, { "url": "https://psychonautwiki.org/wiki/HXE", "name": "HXE", diff --git a/src/discord/commands/global/d.calcMDMA.ts b/src/discord/commands/global/d.calcMDMA.ts new file mode 100644 index 000000000..6da346a03 --- /dev/null +++ b/src/discord/commands/global/d.calcMDMA.ts @@ -0,0 +1,57 @@ +import { + SlashCommandBuilder, +} from 'discord.js'; +import { stripIndents } from 'common-tags'; +import { SlashCommand } from '../../@types/commandDef'; +import { embedTemplate } from '../../utils/embedTemplate'; +import { calcMDMA } from '../../../global/commands/g.calcMDMA'; +import commandContext from '../../utils/context'; + +const F = f(__filename); + +// Calculate insufflated dosages +export const dCalcMDMA: SlashCommand = { + data: new SlashCommandBuilder() + .setName('calc_mdma') + .setDescription('Get MDMA dosage information') + .addNumberOption(option => option.setName('weight') + .setDescription('How much do you weigh?') + .setRequired(true)) + .addStringOption(option => option.setName('units') + .setDescription('In what unit?') + .addChoices( + { name: 'kg', value: 'kg' }, + { name: 'lbs', value: 'lbs' }, + ) + .setRequired(true)) + .addBooleanOption(option => option.setName('ephemeral') + .setDescription('Set to "True" to show the response only to you')), + async execute(interaction) { + log.info(F, await commandContext(interaction)); + await interaction.deferReply({ ephemeral: (interaction.options.getBoolean('ephemeral') === true) }); + const givenWeight = interaction.options.getNumber('weight', true); + const weightUnits = interaction.options.getString('units', true) as 'kg' | 'lbs'; + const embed = embedTemplate(); + const dosageData = await calcMDMA(givenWeight, weightUnits); + + let description = '**MDMA Dosage Information**\n\n'; + + Object.keys(dosageData).forEach(key => { + const title = key.charAt(0).toUpperCase() + key.slice(1); + description += `**${title}**: ${dosageData[key as keyof typeof dosageData]}\n`; + }); + + description += '\n'; + + description += stripIndents` + **It is not recommended to exceed 150mg of MDMA in a single session, including any redoses.** \ + As dosage increases, so does the likelihood of experiencing negative side effects. \ + Keeping doses in the light to medium range can help maximize pleasurable effects while minimizing discomfort. \ + For more information check out [RollSafe](https://rollsafe.org/mdma-dosage/).`; + + await interaction.editReply({ embeds: [embed.setDescription(description)] }); + return true; + }, +}; + +export default dCalcMDMA; diff --git a/src/global/commands/g.calcMDMA.ts b/src/global/commands/g.calcMDMA.ts new file mode 100644 index 000000000..37a6015e4 --- /dev/null +++ b/src/global/commands/g.calcMDMA.ts @@ -0,0 +1,20 @@ +// https://rollsafe.org/mdma-dosage/ + +export async function calcMDMA(weight: number, unit: 'lbs' | 'kg'): Promise<{ + '🌱 First Time': string; + '🔆 Light': string; + '🌟 Common': string; + '💪 Strong': string; + '⚠️ Max': string; +}> { + const weightInKgs = unit === 'lbs' ? weight * 0.453592 : weight; + return { + '🌱 First Time': `${Math.round(weightInKgs * 0.8)}mg (0.8mg/kg)`, + '🔆 Light': `${Math.round(weightInKgs * 1.2)}mg (1.2mg/kg)`, + '🌟 Common': `${Math.round(weightInKgs * 1.5)}mg (1.5mg/kg)`, + '💪 Strong': `${Math.round(weightInKgs * 1.7)}mg (1.7mg/kg)`, + '⚠️ Max': `${Math.round(weightInKgs * 2.0)}mg (2.0mg/kg)`, + }; +} + +export default calcMDMA;