Skip to content

Commit

Permalink
Merge branch 'main' into gpt4o-mini
Browse files Browse the repository at this point in the history
  • Loading branch information
theimperious1 authored Jul 30, 2024
2 parents 953f8ca + a930dd4 commit f4e4c93
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/discord/commands/global/d.testkits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default {
});
embed.setDescription(stripIndents`
[How to use a reagent test kit](https://dancesafe.org/testing-kit-instructions/)
[How to use fentanyl strips](https://dancesafe.org/you-may-be-using-fentanyl-testing-strips-incorrectly/)
[How to use fentanyl strips](https://dancesafe.org/fentanyl/)
[More testkit resources on the TripSit wiki!](https://wiki.tripsit.me/wiki/Test_Kits)
`);
await interaction.editReply({ embeds: [embed] });
Expand Down
2 changes: 1 addition & 1 deletion src/discord/tests/testkits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe(slashCommand.data.name, () => {
title: 'Test Kit Resources and information!',
description: stripIndents`
[How to use a reagent test kit](https://dancesafe.org/testing-kit-instructions/)
[How to use fentanyl strips](https://dancesafe.org/you-may-be-using-fentanyl-testing-strips-incorrectly/)
[How to use fentanyl strips](https://dancesafe.org/fentanyl/)
[More testkit resources on the TripSit wiki!](https://wiki.tripsit.me/wiki/Test_Kits)
`,
fields: [
Expand Down
10 changes: 6 additions & 4 deletions src/discord/utils/messageCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const tripsitChannels = [
env.CHANNEL_WEBTRIPSIT2,
];

/*
const sadStuff = [
'sadface',
':(',
Expand Down Expand Up @@ -56,13 +57,14 @@ const sadStuff = [
'😐',
'😑',
];
*/

const heartEmojis = [
'❤', '🧡', '💛', '💚', '💙', '💜', '💝', '💖', '💗', '💘', '💕', '💞', '💓', '💟', '❣', '🫂',
];

async function isSadMessage(message: Message): Promise<boolean> {
return sadStuff.some(word => (message.cleanContent.includes(word)
async function messageContainsHearts(message: Message): Promise<boolean> {
return heartEmojis.some(word => (message.cleanContent.includes(word)
&& !(message.cleanContent.substring(message.cleanContent.indexOf(':') + 1).includes(':'))));
}

Expand Down Expand Up @@ -383,10 +385,10 @@ give people a chance to answer 😄 If no one answers in 5 minutes you can try a
}
}
}
} else if (await isSadMessage(message)) {
} else if (await messageContainsHearts(message)) {
if (message.author.bot) return;
if (message.guild.id !== env.DISCORD_GUILD_ID) return;
// log.debug(F, 'Sad stuff detected');
// log.debug(F, 'Sad/lovey stuff detected');
await message.react(heartEmojis[Math.floor(Math.random() * heartEmojis.length)]);
}

Expand Down
8 changes: 8 additions & 0 deletions src/global/commands/g.crisis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export async function crisis():Promise<HelpResource[]> {
text: '',
webchat: '',
},
{
name: 'BuddyUp',
country: 'UK',
website: 'https://cranstoun.org/help-and-advice/harm-reduction/buddyup/',
phone: '',
text: '[🍎](https://apps.apple.com/gb/app/buddyup-with-cranstoun/id1601622050) [🤖](https://play.google.com/store/apps/details?id=org.cranstoun.buddyup)', // eslint-disable-line max-len
webchat: '',
},
{
name: 'Talktofrank',
country: 'UK',
Expand Down

0 comments on commit f4e4c93

Please sign in to comment.