Skip to content

Commit

Permalink
Update setContexts & Ephemeral
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMonDon committed Jan 8, 2025
1 parent 01930c7 commit 9d745ee
Show file tree
Hide file tree
Showing 13 changed files with 1,558 additions and 212 deletions.
1,711 changes: 1,528 additions & 183 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"name": "mythical",
"version": "5.3.0",
"version": "5.4.0",
"description": "Mythical Bot",
"owner": "themondon",
"main": "index.js",
"engines": {
"node": ">=16.9.0"
"node": ">=18.18.2"
},
"scripts": {
"lint": "eslint --fix --cache commands/** events/** slash_commands/** base/** util/**",
Expand All @@ -24,6 +24,7 @@
"blackjack-n-deck": "^1.0.1",
"botlist.me.js": "^1.0.2",
"botpanel.js": "^1.2.9",
"canvacord": "^6.0.2",
"canvas": "^2.11.2",
"chalk": "^4.1.1",
"chrono-node": "^2.7.6",
Expand All @@ -38,7 +39,7 @@
"discord-giveaways": "^6.0.0",
"discord-html-transcripts": "^3.2.0",
"discord-player": "^6.6.10",
"discord.js": "^14.15.3",
"discord.js": "^14.17.3",
"emoji-regex": "^10.4.0",
"enmap": "^5.8.6",
"fluent-ffmpeg": "^2.1.2",
Expand Down
4 changes: 2 additions & 2 deletions slash_commands/Administrator/clear-warnings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, MessageFlags } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

Expand All @@ -13,7 +13,7 @@ exports.commandData = new SlashCommandBuilder()
.setDMPermission(false);

exports.run = async (interaction) => {
await interaction.deferReply({ ephemeral: true });
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
const mem = interaction.options.getUser('user');
const color = interaction.settings.embedColor;

Expand Down
4 changes: 2 additions & 2 deletions slash_commands/Administrator/delete-warning.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, MessageFlags } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

Expand All @@ -13,7 +13,7 @@ exports.commandData = new SlashCommandBuilder()
.setDMPermission(false);

exports.run = async (interaction) => {
await interaction.deferReply({ ephemeral: true });
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
let title = 'Case Cleared';
let color = interaction.settings.embedColor;

Expand Down
4 changes: 2 additions & 2 deletions slash_commands/Economy/add-money.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, InteractionContextType } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

Expand All @@ -8,7 +8,7 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('add-money')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription("Add money to a member's cash or bank balance.")
.addMentionableOption((option) =>
option.setName('target').setDescription('The member or role to add money to').setRequired(true),
Expand Down
4 changes: 2 additions & 2 deletions slash_commands/Economy/remove-money.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, InteractionContextType } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

Expand All @@ -8,7 +8,7 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('remove-money')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription("Remove money to a member's cash or bank balance.")
.addMentionableOption((option) =>
option.setName('target').setDescription('The member or role to remove money from').setRequired(true),
Expand Down
5 changes: 3 additions & 2 deletions slash_commands/General/warnings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, InteractionContextType, MessageFlags } = require('discord.js');
const { QuickDB } = require('quick.db');
const moment = require('moment');
const db = new QuickDB();
Expand All @@ -9,11 +9,12 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('warnings')
.setContexts(InteractionContextType.Guild)
.setDescription('View your warnings, or moderators can view other warnings.')
.addUserOption((option) => option.setName('user').setDescription('The user to view warnings of'));

exports.run = async (interaction) => {
await interaction.deferReply({ ephemeral: true });
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
const user = interaction.options.getUser('user');
const level = interaction.user.permLevel;
const warns = [];
Expand Down
4 changes: 2 additions & 2 deletions slash_commands/Moderator/blacklist.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, InteractionContextType } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

Expand All @@ -8,7 +8,7 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('blacklist')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription('Add/remove/check users blacklisted from the bot')
.addSubcommand((subcommand) =>
subcommand
Expand Down
5 changes: 2 additions & 3 deletions slash_commands/Moderator/nickname.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const { SlashCommandBuilder } = require('discord.js');
const { SlashCommandBuilder, InteractionContextType } = require('discord.js');

exports.conf = {
permLevel: 'Moderator',
guildOnly: false,
};

exports.commandData = new SlashCommandBuilder()
.setName('nickname')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription('Change a users nickname')
.addUserOption((option) =>
option.setName('user').setDescription('The user you want to change the nickname of').setRequired(true),
Expand Down
4 changes: 2 additions & 2 deletions slash_commands/Moderator/purge.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require('discord.js');
const { SlashCommandBuilder, InteractionContextType } = require('discord.js');
const amountText = 'The amount of messages to delete';
const delText = 'The text to delete';

Expand All @@ -8,7 +8,7 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('purge')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription('Purge messages')
.addSubcommand((subcommand) =>
subcommand
Expand Down
6 changes: 3 additions & 3 deletions slash_commands/Moderator/unban.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, InteractionContextType, MessageFlags } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

Expand All @@ -8,15 +8,15 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('unban')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription('Unban a user from the server')
.addStringOption((option) =>
option.setName('user_id').setDescription('The User ID of the person to unban').setRequired(true),
)
.addStringOption((option) => option.setName('reason').setDescription('The reason to unban the user'));

exports.run = async (interaction) => {
await interaction.deferReply({ ephemeral: true });
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
if (!interaction.guild.members.me.permissions.has('BanMembers'))
return interaction.editReply('The bot is missing Ban Members permission.');

Expand Down
6 changes: 3 additions & 3 deletions slash_commands/Moderator/warn-info.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, InteractionContextType, MessageFlags } = require('discord.js');
const { QuickDB } = require('quick.db');
const moment = require('moment');
const db = new QuickDB();
Expand All @@ -9,14 +9,14 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('warn-info')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription('View the information of a specific case.')
.addStringOption((option) =>
option.setName('case_id').setDescription('The specific warning to get information on').setRequired(true),
);

exports.run = async (interaction) => {
await interaction.deferReply({ ephemeral: true });
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
const caseID = interaction.options.getString('case_id');
const warn = await db.get(`servers.${interaction.guild.id}.warns.warnings.${caseID}`);

Expand Down
6 changes: 3 additions & 3 deletions slash_commands/Moderator/warn.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { EmbedBuilder, SlashCommandBuilder } = require('discord.js');
const { EmbedBuilder, SlashCommandBuilder, InteractionContextType, MessageFlags } = require('discord.js');
const { QuickDB } = require('quick.db');
const db = new QuickDB();

Expand All @@ -8,7 +8,7 @@ exports.conf = {

exports.commandData = new SlashCommandBuilder()
.setName('warn')
.setDMPermission(false)
.setContexts(InteractionContextType.Guild)
.setDescription('Warns a user, by default members are kicked at 8 and banned at 10 points.')
.addUserOption((option) => option.setName('user').setDescription('The user you want to warn').setRequired(true))
.addIntegerOption((option) =>
Expand All @@ -24,7 +24,7 @@ exports.commandData = new SlashCommandBuilder()
);

exports.run = async (interaction) => {
await interaction.deferReply({ ephemeral: true });
await interaction.deferReply({ flags: MessageFlags.Ephemeral });
const user = interaction.options.getUser('user');

let member = true;
Expand Down

0 comments on commit 9d745ee

Please sign in to comment.