mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 09:20:08 +00:00
fix: nodejs guide template. (#2433)
Co-authored-by: New Author Name <email@address.com>
This commit is contained in:
5
template/.gitignore
vendored
5
template/.gitignore
vendored
@@ -1,6 +1,9 @@
|
||||
.env
|
||||
fileloader.ts
|
||||
|
||||
config.json
|
||||
|
||||
# Folder made by Kwik db to watch guild command versions
|
||||
db/
|
||||
node_modules
|
||||
node_modules
|
||||
package-lock.json
|
||||
@@ -107,7 +107,7 @@ class CommandManager {
|
||||
|
||||
const args = [];
|
||||
//Map all Values and Args
|
||||
interaction.data.options.map((o) => {
|
||||
interaction.data.options?.map((o) => {
|
||||
if (o.name) args.push(o.name);
|
||||
if (o.options) {
|
||||
o.options.map((o2) => {
|
||||
|
||||
@@ -26,7 +26,7 @@ class EventManager extends EventEmitter {
|
||||
return event(...args);
|
||||
};
|
||||
});
|
||||
return this._events;
|
||||
return this.allEvents;
|
||||
}
|
||||
}
|
||||
module.exports = EventManager;
|
||||
|
||||
@@ -10,15 +10,15 @@ class pingcommand extends BaseCommand {
|
||||
super(data);
|
||||
}
|
||||
async execute() {
|
||||
const msg = await this.reply({ content: `Pinging...` });
|
||||
const msg = await this.channel.send({ content: `Pinging...` });
|
||||
//Assign properties to the response
|
||||
const ping = msg.timestamp - this.message.timestamp;
|
||||
const ping = msg.timestamp - (this.message ? this.message.timestamp : this.interaction.timestamp);
|
||||
|
||||
const embed = new Discord.Embed()
|
||||
.setTitle(`The Bots ping is ${ping} ms`)
|
||||
.toJSON();
|
||||
//Edit Message with the Embed
|
||||
return msg.edit({ embeds: [embed] });
|
||||
return this.reply({ embeds: [embed] });
|
||||
}
|
||||
}
|
||||
module.exports = pingcommand;
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
const UtilCommand = require("./CommandResponse.js");
|
||||
const Message = require("./Message.js");
|
||||
const Interaction = require("./Interaction.js");
|
||||
class BaseCommand extends UtilCommand {
|
||||
constructor(data) {
|
||||
super(data);
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
const User = require("../Structures/User");
|
||||
module.exports = async (client, payload) => {
|
||||
client.user = client.users.forge(payload.user);
|
||||
if (payload.shardId + 1 === client.gateway.maxShards) {
|
||||
if (payload.shardId === client.gateway.lastShardId) {
|
||||
//All Shards are ready
|
||||
console.log("Successfully connected to the gateway as " + client.user.tag);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const Discord = require("discordeno.js");
|
||||
|
||||
// Ideally you should switch this to .env but for a template a config json is enough
|
||||
const config = require("../config.json");
|
||||
const config = require("./config.json");
|
||||
|
||||
const EventManager = require("./Managers/EventManager.js");
|
||||
// looping through all events and registering them
|
||||
|
||||
Reference in New Issue
Block a user