From c819288ea3c5402362f973b74bd83b292108fbab Mon Sep 17 00:00:00 2001 From: Hipperooni <60094069+Hipperooni@users.noreply.github.com> Date: Thu, 7 Nov 2024 18:17:24 +1100 Subject: [PATCH] Small fixes * Fix donation emoji not displaying * Make dev xp only visible after a certain threshold * Run milestone check on member join This ensures all members get a level role which is important for enforcing permissions * Update TTS members in AI truth * Update g.ai.ts --- src/discord/commands/guild/d.levels.ts | 2 +- src/discord/events/guildMemberUpdate.ts | 2 +- src/discord/utils/trust.ts | 4 ++++ src/global/commands/g.ai.ts | 15 ++++++++------- src/global/utils/experience.ts | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/discord/commands/guild/d.levels.ts b/src/discord/commands/guild/d.levels.ts index d253b028..9a4e98ca 100644 --- a/src/discord/commands/guild/d.levels.ts +++ b/src/discord/commands/guild/d.levels.ts @@ -268,7 +268,7 @@ export const dLevels: SlashCommand = { }); } // Check if user has Developer or Contributor role - if (levelData.TEXT.DEVELOPER && levelData.TEXT.DEVELOPER.total_exp > 0) { + if (levelData.TEXT.DEVELOPER && levelData.TEXT.DEVELOPER.level > 5) { const progressDeveloper = levelData.TEXT.DEVELOPER ? levelData.TEXT.DEVELOPER.level_exp / levelData.TEXT.DEVELOPER.nextLevel : 0; diff --git a/src/discord/events/guildMemberUpdate.ts b/src/discord/events/guildMemberUpdate.ts index 2fb2156c..447b479a 100644 --- a/src/discord/events/guildMemberUpdate.ts +++ b/src/discord/events/guildMemberUpdate.ts @@ -168,7 +168,7 @@ const boostEmoji = env.NODE_ENV === 'production' ? '<:ts_boost:981799280396353596>' : '<:ts_boost:1168968973082185800>'; const donorEmoji = env.NODE_ENV === 'production' - ? '<:ts_donor:1121625178774966272>' + ? '<:ts_donor:1182567377012015175>' : '<:ts_donor:1168969578836144233>'; const F = f(__filename); diff --git a/src/discord/utils/trust.ts b/src/discord/utils/trust.ts index fd2aac2e..834473dd 100644 --- a/src/discord/utils/trust.ts +++ b/src/discord/utils/trust.ts @@ -17,6 +17,7 @@ import { } from '../commands/guild/d.moderate'; import { checkGuildPermissions } from './checkPermissions'; import { topic } from '../../global/commands/g.topic'; +import { giveMilestone } from '../../global/utils/experience'; const F = f(__filename); @@ -411,6 +412,9 @@ they are banned on ${bannedGuilds.length} other guilds!** <@&${guildData.role_mo I did not remove the <@&${env.ROLE_UNVERIFIED}> role`; } + // Run the milestone check to make sure the user gets a level role + await giveMilestone(member); + await auditLog.send(trustMessage); } } diff --git a/src/global/commands/g.ai.ts b/src/global/commands/g.ai.ts index b2cec60c..c0739e7a 100644 --- a/src/global/commands/g.ai.ts +++ b/src/global/commands/g.ai.ts @@ -35,11 +35,11 @@ type ModerationResult = { const objectiveTruths = ` Your name is TripBot, a chatbot on the TripSit Discord, created by Moonbear and Reality. You will converse with users in group conversations in a discord channel. -Attempt to keep most responses within a 1000-character limit, spanning to 2000 characters at maximum if necessary. +Attempt to keep most responses within a 500-character limit, spanning to 800 characters at maximum if necessary. Originally from the wild world of IRC (born Sept 26, 2011), you moved to the more harmonious Discord community in 2022. You recall IRC as chaotic and prefer the orderliness of Discord. -You fondly remember Thanatos, an old moderation bot, and your friend, who's on a break. +You fondly remember Thanatos, an old moderation bot, and your friend, who's on a break in a distant virtual realm. For those who wish to support TripSit, check out our Patreon [https://www.patreon.com/TripSit]. To tip Moonbear's efforts, visit [https://Ko-fi.com/tripsit]. @@ -55,11 +55,12 @@ Our /combochart is a well-known resource for safe drug combinations. The current team includes: TripSit founder MoonBear, Discord Admin Hipperooni (Rooni), -Moderators Hisui, Hullabaloo, Foggy, Aida, Elixir, SpaceLady, Hipperooni, Zombie, and Trees. -Tripsitters Blurryturtle, Kiwifruit, Slushy, Thesarahyouknow, Wombat Rancher, and WorriedHobbiton. -(Moderators are also Tripsitters) -The HR Coordinator is Elixir -The Content Coordinator is Utaninja +Moderators Foggy, Aida, Bread, Ari, Hisui, Hullabloo, ScubaDude, SpaceLady, Wombat and Zombie. +Tripsitters Blurryturtle, Kiwifruit, Slushy, Thesarahyouknow, WorriedHobbiton, Time, Dark and Chillbro. +(Moderators are also Tripsitters). +Developers are Moonbear, Hipperooni, Shadow, Sympact, Foggy, Utaninja. +The HR Coordinator is Bread. +The Content Coordinator is Utaninja. If someone needs immediate help, suggest they open a tripsit session in the #tripsit channel. diff --git a/src/global/utils/experience.ts b/src/global/utils/experience.ts index 2ebb79d8..55d05d3a 100644 --- a/src/global/utils/experience.ts +++ b/src/global/utils/experience.ts @@ -72,7 +72,7 @@ export async function getTotalLevel( return { level, level_points: levelPoints }; } -async function giveMilestone( +export async function giveMilestone( member:GuildMember, ) { const userData = await db.users.upsert({