Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Add cooldown utility & apply it to tripsitme, prevent checkMoodle timer function from giving the 101 role back during TripSit sessions" #913

Merged
merged 1 commit into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions src/discord/utils/commandCooldown.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/discord/utils/tripsitme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import { ticket_status, user_tickets } from '@prisma/client';
import commandContext from './context';
import { embedTemplate } from './embedTemplate';
import { checkChannelPermissions, checkGuildPermissions } from './checkPermissions';
import { commandCooldown } from './commandCooldown';

const F = f(__filename);

Expand Down Expand Up @@ -843,13 +842,6 @@ export async function tripsitmeUserClose(
if (!interaction.channel) return;
log.info(F, await commandContext(interaction));

const cooldown = await commandCooldown(interaction.user, interaction.customId);

if (!cooldown.success && cooldown.message) {
await interaction.reply({ content: cooldown.message, ephemeral: true });
return;
}

await interaction.deferReply({ ephemeral: false });

const targetId = interaction.customId.split('~')[1];
Expand Down Expand Up @@ -1195,12 +1187,6 @@ export async function tripSitMe(
return null;
}

const cooldown = await commandCooldown(interaction.user, interaction.customId);

if (!cooldown.success && cooldown.message) {
await interaction.editReply(cooldown.message);
}

// const actor = interaction.member;
const guildData = await db.discord_guilds.upsert({
where: {
Expand Down Expand Up @@ -1481,13 +1467,6 @@ export async function tripsitmeButton(
log.info(F, await commandContext(interaction));
const target = interaction.member as GuildMember;

const cooldown = await commandCooldown(interaction.user, interaction.customId);

if (!cooldown.success && cooldown.message) {
await interaction.reply({ content: cooldown.message, ephemeral: true });
return;
}

// log.debug(F, `target: ${JSON.stringify(target, n ull, 2)}`);

// const actorIsAdmin = target.permissions.has(PermissionsBitField.Flags.Administrator);
Expand Down
9 changes: 3 additions & 6 deletions src/global/utils/timer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1075,12 +1075,9 @@ async function checkMoodle() { // eslint-disable-line
},
); // eslint-disable-line
}
if (!member.roles.cache.has(env.ROLE_NEEDS_HELP)) {
member.roles.add(role);
log.info(F, `Gave ${member.user.username} the ${role.name} role`);
} else {
log.info(F, `Skipped giving ${member.user.username} the ${role.name} because they have the Needs Help role`);
}

member.roles.add(role);
log.info(F, `Gave ${member.user.username} the ${role.name} role`);

// eslint-disable max-len
member.user.send({
Expand Down
Loading