diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-29 17:53:45 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-08-29 17:53:45 -0400 |
commit | 0d71ac0234f7e71d60ae727a9f1db9ad66a47bde (patch) | |
tree | 3596afd9f922d17dfeb599adb1745d0db0b9062e /src | |
parent | 6ffa1bae9a502d3bf52a71ed1b7a6f3d989b4abe (diff) | |
download | tanzanite-0d71ac0234f7e71d60ae727a9f1db9ad66a47bde.tar.gz tanzanite-0d71ac0234f7e71d60ae727a9f1db9ad66a47bde.tar.bz2 tanzanite-0d71ac0234f7e71d60ae727a9f1db9ad66a47bde.zip |
added suicide command
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/utilities/suicide.ts | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/commands/utilities/suicide.ts b/src/commands/utilities/suicide.ts new file mode 100644 index 0000000..0ec84a5 --- /dev/null +++ b/src/commands/utilities/suicide.ts @@ -0,0 +1,52 @@ +import { AllowedMentions, BushCommand, BushMessage, BushSlashMessage } from '@lib'; +import { MessageEmbed } from 'discord.js'; + +export default class TemplateCommand extends BushCommand { + public constructor() { + super('suicide', { + aliases: ['suicide'], + category: 'utilities', + description: { + content: 'Mental Health Resources. Credit to https://github.com/dexbiobot/Zeppelin.', + usage: 'suicide', + examples: ['suicide'] + }, + slash: true, + clientPermissions: ['SEND_MESSAGES'], + userPermissions: ['SEND_MESSAGES'] + }); + } + + public override async exec(message: BushMessage | BushSlashMessage): Promise<unknown> { + // stolen from https://github.com/dexbiobot/Zeppelin + const suicideEmbed = new MessageEmbed() + .setTitle('Mental Health Resources') + .setColor(util.colors.red) + .setAuthor( + 'Remember, You Matter <3', + 'https://media.discordapp.net/attachments/770256340639416320/854689949193076737/Medical_31-60_974.jpg?width=523&height=523' + ) + .addField( + '**National Suicide Prevention Hotline (U.S.):**', + `**Call:** 1-800-273-8255, available 24/7 for emotional support +**Text: HOME** to 741741 +https://suicidepreventionlifeline.org/chat/ + +Outside the U.S: Find a supportive resource on [this Wikipedia list of worldwide crisis hotlines](https://en.wikipedia.org/wiki/List_of_suicide_crisis_lines)` + ) + .addField( + '**More Support**', + `For Substance Abuse Support, Eating Disorder Support & Child Abuse and Domestic Violence: +[Click to go to Discord's Health & Safety Page](https://discord.com/safety/360044103771-Mental-health-on-Discord#h_01EGRGT08QSZ5BNCH2E9HN0NYV)` + ); + + return ( + // If the original message was a reply -> imitate it + (message as BushMessage).reference?.messageId && !message.util.isSlash && message.guild && message.channel + ? await message.channel.messages.fetch((message as BushMessage).reference!.messageId!).then(async (message1) => { + await message1.reply({ embeds: [suicideEmbed], allowedMentions: AllowedMentions.users(), target: message1 }); + }) + : await message.util.send({ embeds: [suicideEmbed], allowedMentions: AllowedMentions.users() }) + ); + } +} |