Skip to content

Removed Deprecated function arguments #133

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 5 additions & 8 deletions src/modules/core/set.command.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import {
ActionRowBuilder,
ApplicationCommandOptionType,
ApplicationCommandType,
ButtonBuilder,
ButtonStyle,
Colors,
ComponentType,
GuildMember,
} from "discord.js";
import { Command } from "djs-slash-helper";

import {
ApplicationCommandOptionType,
ApplicationCommandType,
} from "discord.js";
import { DDUser, getOrCreateUserById } from "../../store/models/DDUser.js";
import { createStandardEmbed } from "../../util/embeds.js";
import { mentionIfPingable } from "../../util/users.js";
Expand Down Expand Up @@ -93,7 +90,7 @@ export const SetCommand: Command<ApplicationCommandType.ChatInput> = {
const reply = await interaction.reply({
embeds: [embed],
components: [buttons],
fetchReply: true,
withResponse: false,
});

const channel = interaction.channel;
Expand All @@ -118,15 +115,15 @@ export const SetCommand: Command<ApplicationCommandType.ChatInput> = {
const event = await collector.next;
if (event.customId === "cancel") {
await event.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "**Cancelled**",
});
} else if (event.customId === "confirm") {
await event.deferReply();
setter(user, value);
await user.save();
await event.followUp({
ephemeral: true,
flags: ["Ephemeral"],
embeds: [
createStandardEmbed(target)
.setTitle("Success")
Expand Down
18 changes: 9 additions & 9 deletions src/modules/faq/faq.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Command, ExecutableSubcommand } from "djs-slash-helper";
import {
ApplicationCommandOptionType,
ApplicationCommandType,
GuildMember,
PermissionFlagsBits,
} from "discord.js";
import { FAQ } from "../../store/models/FAQ.js";
import { createFaqEmbed } from "./faq.util.js";
import createFaqModal from "./faq.modal.js";
import { moduleManager } from "../../index.js";
import { logger } from "../../logging.js";
import { GuildMember } from "discord.js";

const choices: Array<{ name: string; value: string }> = [];

Expand Down Expand Up @@ -45,7 +45,7 @@ const GetSubcommand: ExecutableSubcommand = {
});
if (faq == null) {
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "No FAQ found with this name",
});
}
Expand All @@ -69,14 +69,14 @@ const EditSubcommand: ExecutableSubcommand = {
const member = interaction.member as GuildMember;
if (!member.permissions.has(PermissionFlagsBits.ManageMessages)) {
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "No permission",
});
}
const name = interaction.options.get("name")?.value as string | null;
if (name == null) {
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "No FAQ name provided",
});
}
Expand All @@ -97,7 +97,7 @@ const EditSubcommand: ExecutableSubcommand = {
author: BigInt(interaction.user.id),
});
await response.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: `FAQ named ${name} created`,
});

Expand All @@ -123,30 +123,30 @@ const DeleteSubcommand: ExecutableSubcommand = {
const member = interaction.member as GuildMember;
if (!member.permissions.has(PermissionFlagsBits.ManageMessages)) {
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "No permission",
});
}
const name = interaction.options.get("name")?.value as string | null;
if (name == null) {
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "No FAQ name provided",
});
}

const faq = await FAQ.findOne({ where: { name } });
if (faq == null) {
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "No FAQ found with this name",
});
}
await faq.destroy();
await updateChoices();
await moduleManager.refreshCommands();
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: `FAQ named ${name} deleted`,
});
},
Expand Down
6 changes: 3 additions & 3 deletions src/modules/information/informationMessage.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export const InformationMessageCommand: Command<ApplicationCommandType.Message>
async handle(interaction) {
if (!interaction.targetMessage.editable) {
await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "I can't edit that message.",
});
return;
}

if (config.informationMessage == null) {
await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "There is no information message configured.",
});
return;
Expand Down Expand Up @@ -63,7 +63,7 @@ export const InformationMessageCommand: Command<ApplicationCommandType.Message>
)}`,
);
await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "Information message set.",
});
},
Expand Down
8 changes: 4 additions & 4 deletions src/modules/information/informationMessage.listener.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const InformationButtonListener: EventListener = {

await interaction.followUp({
embeds: [embed],
ephemeral: true,
flags: ["Ephemeral"],
});
return;
}
Expand Down Expand Up @@ -72,7 +72,7 @@ export const InformationButtonListener: EventListener = {
(interaction.member as GuildMember) ?? undefined,
);
await interaction.followUp({
ephemeral: true,
flags: ["Ephemeral"],
embeds: [embed],
});
},
Expand Down Expand Up @@ -102,7 +102,7 @@ async function sendLearningResourcesPicker(interaction: ButtonInteraction) {
components: [
new ActionRowBuilder<SelectMenuBuilder>().addComponents(selectMenu),
],
ephemeral: true,
fetchReply: true,
flags: ["Ephemeral"],
withResponse: false,
});
}
4 changes: 2 additions & 2 deletions src/modules/learning/learning.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const LearningUpdateSubcommand: ExecutableSubcommand = {
const member = interaction.member as GuildMember;
if (!member.permissions.has(PermissionFlagsBits.ManageMessages)) {
return await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
content: "No permission",
});
}
Expand Down Expand Up @@ -165,7 +165,7 @@ const LearningListSubcommand: ExecutableSubcommand = {
});

await interaction.reply({
ephemeral: true,
flags: ["Ephemeral"],
embeds: [embed],
});
},
Expand Down
2 changes: 1 addition & 1 deletion src/modules/roles/roleColour.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const SetSubcommand: ExecutableSubcommand = {
if (!colour.startsWith("#") || colour.length !== 7) {
await interaction.reply({
content: "Not a valid colour",
ephemeral: true,
flags: ["Ephemeral"],
});
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/modules/xp/dailyReward.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const DailyRewardCommand: Command<ApplicationCommandType.ChatInput> = {
await interaction.deferReply();
if (dailiesInProgress.has(user.id)) {
await interaction.followUp({
ephemeral: true,
flags: ["Ephemeral"],
content: "You are already claiming your daily reward!",
});
return;
Expand All @@ -45,7 +45,7 @@ export const DailyRewardCommand: Command<ApplicationCommandType.ChatInput> = {
}
const nextClaimTime = getNextDailyTimeFrom(lastClaimTime);
await interaction.followUp({
ephemeral: true,
flags: ["Ephemeral"],
content: `You can only claim your daily reward once every 24 hours. You can claim it again <t:${Math.floor(
nextClaimTime.getTime() / 1000,
)}:R>.`,
Expand Down
Loading