Skip to content

Commit

Permalink
Revert "Merge remote-tracking branch 'origin/main' into main"
Browse files Browse the repository at this point in the history
This reverts commit feb116b.
  • Loading branch information
eartharoid committed Oct 26, 2021
1 parent feb116b commit f49a044
Show file tree
Hide file tree
Showing 15 changed files with 60 additions and 61 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eartharoid/discord-tickets",
"version": "3.1.4",
"version": "3.1.2",
"private": true,
"description": "An open-source Discord bot for ticket management",
"main": "src/index.js",
Expand Down
8 changes: 4 additions & 4 deletions src/commands/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = class AddCommand extends Command {
const t_row = await this.client.tickets.resolve(channel.id, interaction.guild.id);

if (!t_row) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -56,7 +56,7 @@ module.exports = class AddCommand extends Command {
const member = interaction.options.getMember(default_i18n('commands.add.options.member.name'));

if (!member) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -69,7 +69,7 @@ module.exports = class AddCommand extends Command {
}

if (t_row.creator !== interaction.member.id && !await this.client.utils.isStaff(interaction.member)) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -81,7 +81,7 @@ module.exports = class AddCommand extends Command {
});
}

await interaction.editReply({
await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand Down
12 changes: 6 additions & 6 deletions src/commands/blacklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = class BlacklistCommand extends Command {
const type = member_or_role instanceof Role ? 'role' : 'member';

if (type === 'member' && await this.client.utils.isStaff(member_or_role)) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -78,7 +78,7 @@ module.exports = class BlacklistCommand extends Command {
}

blacklist[type + 's'].push(member_or_role.id);
await interaction.editReply({
await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand All @@ -97,7 +97,7 @@ module.exports = class BlacklistCommand extends Command {
const index = blacklist[type + 's'].findIndex(element => element === member_or_role.id);

if (index === -1) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -110,7 +110,7 @@ module.exports = class BlacklistCommand extends Command {
}

blacklist[type + 's'].splice(index, 1);
await interaction.editReply({
await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand All @@ -125,7 +125,7 @@ module.exports = class BlacklistCommand extends Command {
}
case default_i18n('commands.blacklist.options.show.name'): {
if (blacklist.members.length === 0 && blacklist.roles.length === 0) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.colour)
Expand All @@ -138,7 +138,7 @@ module.exports = class BlacklistCommand extends Command {
} else {
const members = blacklist.members.map(id => `**·** <@${id}>`);
const roles = blacklist.roles.map(id => `**·** <@&${id}>`);
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.colour)
Expand Down
16 changes: 8 additions & 8 deletions src/commands/close.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ module.exports = class CloseCommand extends Command {

if (time) {
if (!await this.client.utils.isStaff(interaction.member)) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -69,7 +69,7 @@ module.exports = class CloseCommand extends Command {
try {
period = ms(time);
} catch {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -89,7 +89,7 @@ module.exports = class CloseCommand extends Command {
});

if (tickets.count === 0) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -100,7 +100,7 @@ module.exports = class CloseCommand extends Command {
ephemeral: true
});
} else {
await interaction.editReply({
await interaction.reply({
components: [
new MessageActionRow()
.addComponents(
Expand Down Expand Up @@ -193,7 +193,7 @@ module.exports = class CloseCommand extends Command {
if (ticket) {
t_row = await this.client.tickets.resolve(ticket, interaction.guild.id);
if (!t_row) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -207,7 +207,7 @@ module.exports = class CloseCommand extends Command {
} else {
t_row = await this.client.db.models.Ticket.findOne({ where: { id: interaction.channel.id } });
if (!t_row) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -221,7 +221,7 @@ module.exports = class CloseCommand extends Command {
}

if (t_row.creator !== interaction.member.id && !await this.client.utils.isStaff(interaction.member)) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -233,7 +233,7 @@ module.exports = class CloseCommand extends Command {
});
}

await interaction.editReply({
await interaction.reply({
components: [
new MessageActionRow()
.addComponents(
Expand Down
2 changes: 1 addition & 1 deletion src/commands/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = class HelpCommand extends Command {
: command.description;
return `**\`/${command.name}\` ·** ${description}`;
});
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.colour)
Expand Down
12 changes: 6 additions & 6 deletions src/commands/new.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = class NewCommand extends Command {
],
ephemeral: true
};
await i ? i.editReply(response) : interaction.editReply(response);
await i ? i.editReply(response) : interaction.reply(response);
} else {
const list = tickets.rows.map(row => {
if (row.topic) {
Expand All @@ -81,7 +81,7 @@ module.exports = class NewCommand extends Command {
],
ephemeral: true
};
await i ? i.editReply(response) : interaction.editReply(response);
await i ? i.editReply(response) : interaction.reply(response);
}
} else {
try {
Expand All @@ -98,7 +98,7 @@ module.exports = class NewCommand extends Command {
],
ephemeral: true
};
await i ? i.editReply(response) : interaction.editReply(response);
await i ? i.editReply(response) : interaction.reply(response);
} catch (error) {
const response = {
components: [],
Expand All @@ -112,15 +112,15 @@ module.exports = class NewCommand extends Command {
],
ephemeral: true
};
await i ? i.editReply(response) : interaction.editReply(response);
await i ? i.editReply(response) : interaction.reply(response);
}
}
};

const categories = await this.client.db.models.Category.findAndCountAll({ where: { guild: interaction.guild.id } });

if (categories.count === 0) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -133,7 +133,7 @@ module.exports = class NewCommand extends Command {
} else if (categories.count === 1) {
create(categories.rows[0]); // skip the category selection
} else {
await interaction.editReply({
await interaction.reply({
components: [
new MessageActionRow()
.addComponents(
Expand Down
6 changes: 3 additions & 3 deletions src/commands/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ module.exports = class PanelCommand extends Command {
const thumbnail = interaction.options.getString(default_i18n('commands.panel.options.thumbnail.name'));

if (just_type && categories.length > 1) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -98,7 +98,7 @@ module.exports = class PanelCommand extends Command {
});

if (invalid_category) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand Down Expand Up @@ -196,7 +196,7 @@ module.exports = class PanelCommand extends Command {
}
}

interaction.editReply({
interaction.reply({
content: `✅ ${panel_channel}`,
ephemeral: true
});
Expand Down
8 changes: 4 additions & 4 deletions src/commands/remove.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = class RemoveCommand extends Command {
const t_row = await this.client.tickets.resolve(channel.id, interaction.guild.id);

if (!t_row) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -56,7 +56,7 @@ module.exports = class RemoveCommand extends Command {
const member = interaction.options.getMember(default_i18n('commands.remove.options.member.name'));

if (!member) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -69,7 +69,7 @@ module.exports = class RemoveCommand extends Command {
}

if (t_row.creator !== interaction.user.id && !await this.client.utils.isStaff(interaction.member)) {
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -81,7 +81,7 @@ module.exports = class RemoveCommand extends Command {
});
}

await interaction.editReply({
await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand Down
14 changes: 7 additions & 7 deletions src/commands/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ module.exports = class SettingsCommand extends Command {
roles
});
await this.client.commands.updatePermissions(interaction.guild);
interaction.editReply({
interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand All @@ -249,7 +249,7 @@ module.exports = class SettingsCommand extends Command {
const channel = this.client.channels.cache.get(interaction.options.getString(default_i18n('commands.settings.options.categories.options.delete.options.id.name')));
if (channel) channel.delete();
await category.destroy();
interaction.editReply({
interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand All @@ -258,7 +258,7 @@ module.exports = class SettingsCommand extends Command {
ephemeral: true
});
} else {
interaction.editReply({
interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand All @@ -272,7 +272,7 @@ module.exports = class SettingsCommand extends Command {
case default_i18n('commands.settings.options.categories.options.edit.name'): {
const category = await this.client.db.models.Category.findOne({ where: { id: interaction.options.getString(default_i18n('commands.settings.options.categories.options.delete.options.id.name')) } });
if (!category) {
return interaction.editReply({
return interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.error_colour)
Expand Down Expand Up @@ -304,7 +304,7 @@ module.exports = class SettingsCommand extends Command {
if (roles !== null) category.set('roles', roles.match(/\d{17,19}/g) ?? []);
if (survey !== null) category.set('survey', survey);
await category.save();
interaction.editReply({
interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand All @@ -316,7 +316,7 @@ module.exports = class SettingsCommand extends Command {
}
case default_i18n('commands.settings.options.categories.options.list.name'): {
const categories = await this.client.db.models.Category.findAll({ where: { guild: interaction.guild.id } });
await interaction.editReply({
await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.colour)
Expand All @@ -343,7 +343,7 @@ module.exports = class SettingsCommand extends Command {
if (log_messages !== null) settings.set('log_messages', log_messages);
if (success_colour !== null) settings.set('success_colour', success_colour.toUpperCase());
await settings.save();
interaction.editReply({
interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.success_colour)
Expand Down
2 changes: 1 addition & 1 deletion src/commands/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@ module.exports = class StatsCommand extends Command {
embeds.push(global_embed);
}

await interaction.editReply({ embeds });
await interaction.reply({ embeds });
}
};
4 changes: 2 additions & 2 deletions src/commands/survey.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ module.exports = class SurveyCommand extends Command {
`${survey.name}.html`
);

return await interaction.editReply({
return await interaction.reply({
ephemeral: true,
files: [attachment]
});
} else {
const surveys = await this.client.db.models.Survey.findAll({ where: { guild: interaction.guild.id } });

const list = surveys.map(s => `❯ **\`${s.name}\`**`);
return await interaction.editReply({
return await interaction.reply({
embeds: [
new MessageEmbed()
.setColor(settings.colour)
Expand Down
Loading

0 comments on commit f49a044

Please sign in to comment.