Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

feat: d.js v14 #165

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
2 changes: 1 addition & 1 deletion commands/conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ change it for that guild. The `add` action adds a key to the configuration of ev
your bot. The `del` action removes the key also from every guild, and loses its value forever.
*/

const { codeBlock } = require("@discordjs/builders");
const { codeBlock } = require("discord.js");
const config = require("../config.js");
const { awaitReply } = require("../modules/functions.js");
const { settings } = require("../modules/settings.js");
Expand Down
2 changes: 1 addition & 1 deletion commands/eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// can be used to do **anything** on your machine, from stealing information to
// purging the hard drive. DO NOT LET ANYONE ELSE USE THIS

const { codeBlock } = require("@discordjs/builders");
const { codeBlock } = require("discord.js");

/*
MESSAGE CLEAN FUNCTION
Expand Down
2 changes: 1 addition & 1 deletion commands/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ command is also filtered by level, so if a user does not have access to
a command, it is not shown to them. If a command name is given with the
help command, its extended help is shown.
*/
const { codeBlock } = require("@discordjs/builders");
const { codeBlock } = require("discord.js");
const { toProperCase } = require("../modules/functions.js");

exports.run = (client, message, args, level) => {
Expand Down
2 changes: 1 addition & 1 deletion commands/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// const action = args[0]; const key = args[1]; const value = args.slice(2);
// OR the same as:
// const [action, key, ...value] = args;
const { codeBlock } = require("@discordjs/builders");
const { codeBlock } = require("discord.js");
const { settings } = require("../modules/settings.js");
const { awaitReply } = require("../modules/functions.js");

Expand Down
2 changes: 1 addition & 1 deletion commands/stats.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { version } = require("discord.js");
const { codeBlock } = require("@discordjs/builders");
const { codeBlock } = require("discord.js");
WilsontheWolf marked this conversation as resolved.
Show resolved Hide resolved
const { DurationFormatter } = require("@sapphire/time-utilities");
const durationFormatter = new DurationFormatter();

Expand Down
8 changes: 5 additions & 3 deletions config.js.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Intents } = require("discord.js");
const { IntentsBitField, Partials } = require("discord.js");

/* config */
const config = {
Expand All @@ -12,11 +12,13 @@ const config = {
* Intents the bot needs.
* By default GuideBot needs Guilds, Guild Messages and Direct Messages to work.
* For join messages to work you need Guild Members, which is privileged and requires extra setup.
* The bot also needs the Message Content intent to receive messages with its prefix. This is also privileged.
* If this intent isn't provided you will need to ping the bot to use text commands.
* For more info about intents see the README.
*/
intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES ],
intents: [IntentsBitField.Flags.Guilds, IntentsBitField.Flags.GuildMessages, IntentsBitField.Flags.DirectMessages ],
WilsontheWolf marked this conversation as resolved.
Show resolved Hide resolved
// Partials your bot may need should go here, CHANNEL is required for DM's
partials: ["CHANNEL"],
partials: [Partials.Channel],

/*
* Default per-server settings. These settings are entered in a database on first load,
Expand Down
3 changes: 2 additions & 1 deletion events/interactionCreate.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const logger = require("../modules/logger.js");
const { getSettings, permlevel } = require("../modules/functions.js");
const config = require("../config.js");
const { InteractionType } = require("discord.js");

module.exports = async (client, interaction) => {
// If it's not a command, stop.
if (!interaction.isCommand()) return;
if (interaction.type !== InteractionType.ApplicationCommand) return;
WilsontheWolf marked this conversation as resolved.
Show resolved Hide resolved

// Grab the settings for this server from Enmap.
// If there is no guild, get default conf (DMs)
Expand Down
Loading