Git Product home page Git Product logo

discord-logs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

discord-logs's Issues

Suggestion

Make the logs when a person boost a server (:

voiceChannelJoin wasn't emited if member comes from other voice channel

If member comes from other voice channel, then voiceChannelJoin will not be emited
Steps for reproduce:

const Discord = require('discord.js')
const client = new Discord.Client()
const logs = require('discord-logs')
logs(client)

client.on("voiceChannelJoin", (member, channel) => {
  console.log(member.user.tag+" joined "+channel.name+"!");
});

client.login(TOKEN);

Join some channel, i.e called channel1, you will see it logged. After that join another voice channe, i.e channel2, and you will see it not logged.

Discord-logs: v1.7.5
Discord.js: v12.2

New Event: Accepting the rules.

It determines the events that will happen when someone accepts the rules. Like this:

client.on("rules", async (member, status) => {
console.log(status) // it must be True
})

Any Client Event Parameter

When you specify the event it becomes any.

  • [You can add this ] "export interface ClientEvents extends BaseClientEvents"

Below is the list with the parameters:

  /** https://discord-logs.js.org/ */

  /** Channel Events -> Events related to the channelUpdate event. */
 
  guildChannelTopicUpdate: [ channel: GuildChannel, oldTopic: String, newTopic: String ];
  guildChannelPermissionsUpdate: [ channel: GuildChannel, oldPermissions: PermissionOverwrites, newPermissions: PermissionOverwrites ];
  unhandledGuildChannelUpdate: [ oldChannel: GuildChannel, newChannel: GuildChannel ];
  
  /** Guild Member Events -> Events related to the guildMemberUpdate event. */

  guildMemberBoost: [ member: GuildMember ];
  guildMemberUnboost: [ member: GuildMember ];
  guildMemberRoleAdd: [ member: GuildMember, role: Role ];
  guildMemberRoleRemove: [ member: GuildMember, role: Role ];
  guildMemberNicknameUpdate: [ member: GuildMember, oldNickname: String, newNickname: String ];
  guildMemberEntered: [ member: GuildMember ];
  unhandledGuildMemberUpdate: [ oldMember: GuildMember, newMember: GuildMember ];

  /** Guild Events -> Events related to the guildUpdate event. */
 
  guildBoostLevelUp: [ guild: Guild, oldLevel: Number, newLevel: Number ];
  guildBoostLevelDown: [ guild: Guild, oldLevel: Number, newLevel: Number ];
  guildBannerAdd: [ guild: Guild, bannerURL: String ];
  guildAfkChannelAdd: [ guild: Guild, afkChannel: String ];
  guildVanityURLAdd: [ guild: Guild, vanityURL: String ];
  guildVanityURLRemove: [ guild: Guild, vanityURL: String ];
  guildVanityURLUpdate: [ guild: Guild, oldVanityURL: String, newVanityURL: String ];
  guildFeaturesUpdate: [ oldGuild: Guild, newGuild: Guild ];
  guildAcronymUpdate: [ oldGuild: Guild, newGuild: Guild ];
  guildOwnerUpdate: [ oldGuild: Guild, newGuild: Guild ];
  guildPartnerAdd: [ guild: Guild ];
  guildPartnerRemove: [ guild: Guild ];
  guildVerificationAdd: [ guild: Guild ];
  guildVerificationRemove: [ guild: Guild ];
  unhandledGuildUpdate: [ oldGuild: Guild, newGuild: Guild ];

  /** Message Events -> Events related to the messageUpdate event. */
  
  messagePinned: [ message: Message ];
  messageContentEdited: [ message: Message, oldContent: String, newContent: String ];
  unhandledMessageUpdate: [ oldMessage: Message, newMessage: Message ];
  
  /** Presence Events -> Events related to the presenceUpdate event. */

  guildMemberOffline: [ member: GuildMember, oldStatus: Status ];
  guildMemberOnline: [ member: GuildMember, newStatus: Status ];
  unhandledPresenceUpdate: [ oldPresence: Presence, newPresence: Presence ];

  /** Role Events -> Events related to the roleUpdate event. */

  rolePositionUpdate: [ role: Role, oldPosition: Number, newPosition: Number ];
  rolePermissionsUpdate: [ role: Role, oldPermissions: Number, newPermissions: Number ];
  unhandledRoleUpdate: [ oldRole: Role, newRole: Role, ];

  /** Thread Channel Events -> Events related to the threadUpdate event. */

  threadStateUpdate: [ oldThread: ThreadChannel, newThread: ThreadChannel ];
  threadNameUpdate: [ thread: ThreadChannel, oldName: String, newName: String ];
  threadLockStateUpdate: [ oldThread: ThreadChannel, newThread: ThreadChannel ];
  threadRateLimitPerUserUpdate: [ thread: ThreadChannel, oldRateLimitPerUser: Number, newRateLimitPerUser: Number ];
  threadAutoArchiveDurationUpdate: [ thread: ThreadChannel, oldAutoArchiveDuration: Number, newAutoArchiveDuration: Number ];
  unhandledThreadUpdate: [ oldThread: ThreadChannel, newThread: ThreadChannel ];

  /** User Events -> Events related to the userUpdate event. */

  userAvatarUpdate: [ user: User, oldAvatarURL: String, newAvatarURL: String ];
  userUsernameUpdate: [ user: User, oldUsername: String, newUsername: String ];
  userDiscriminatorUpdate: [ user: User, oldDiscriminator: String, newDiscriminator: String ];
  userFlagsUpdate: [ user: User, oldFlags: String, newFlags: String ];
  unhandledUserUpdate: [ oldUser: User, newUser: User ];

  /** Voice Events -> Events related to the voiceStateUpdate event. */

  voiceChannelJoin: [ member: GuildMember, channel: GuildChannel ];
  voiceChannelLeave: [ member: GuildMember, channel: GuildChannel ];
  voiceChannelSwitch: [ member: GuildMember, oldChannel: GuildChannel, newChannel: GuildChannel ];
  voiceChannelMute: [ member: GuildMember, type: "self-muted" | "server-muted" ];
  voiceChannelUnmute: [ member: GuildMember, type: "self-muted" | "server-muted" ];
  voiceChannelDeaf: [ member: GuildMember, type: "self-deafed" | "server-deafed" ];
  voiceChannelUndeaf: [ member: GuildMember, type: "self-deafed" | "server-deafed" ];
  voiceStreamingStart: [ member: GuildMember, type: GuildChannel ];
  voiceStreamingStop: [ member: GuildMember, type: GuildChannel ];

Error on discord.js v14

In discord.js 14.3.0 (V14) Module gives that error

TypeError: discord_js_1.Intents is not a constructor
at C:\Users\user\Desktop\v14-Altpayi-main\node_modules\discord-logs\lib\index.js:47:19
at step (C:\Users\user\Desktop\v14-Altpayi-main\node_modules\discord-logs\lib\index.js:33:23)
at Object.next (C:\Users\user\Desktop\v14-Altpayi-main\node_modules\discord-logs\lib\index.js:14:53)
at C:\Users\user\Desktop\v14-Altpayi-main\node_modules\discord-logs\lib\index.js:8:71
at new Promise ()
at __awaiter (C:\Users\user\Desktop\v14-Altpayi-main\node_modules\discord-logs\lib\index.js:4:12)
at module.exports (C:\Users\user\Desktop\v14-Altpayi-main\node_modules\discord-logs\lib\index.js:41:54)
at Object. (C:\Users\user\Desktop\v14-Altpayi-main\main.js:5:1)
at Module._compile (node:internal/modules/cjs/loader:1126:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)

discord-logs version: ^2.0.1
Node.js version: 16.17.0

TypeError: discord_js_1.Intents is not a constructor

Promise:

Promise {
  <rejected> TypeError: discord_js_1.Intents is not a constructor
      at /home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:47:19
      at step (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:33:23)
      at Object.next (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:14:53)
      at /home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:8:71
      at new Promise (<anonymous>)
      at __awaiter (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:4:12)
      at module.exports (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:41:54)
      at Object.<anonymous> (/home/pi/Bots/Popcorn/Structures/index.js:17:1)
      at Module._compile (node:internal/modules/cjs/loader:1105:14)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
}

Reason:

TypeError: discord_js_1.Intents is not a constructor
    at /home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:47:19
    at step (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:33:23)
    at Object.next (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:14:53)
    at /home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:4:12)
    at module.exports (/home/pi/Bots/Popcorn/node_modules/discord-logs/lib/index.js:41:54)
    at Object.<anonymous> (/home/pi/Bots/Popcorn/Structures/index.js:17:1)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)

Error

/app/tests/test.js:9 console.log("Ready. Logged as "+client.user.tag+" in "+client.guilds.cache.size+" servers."); ^ TypeError: Cannot read property 'size' of undefined at Client.client.on (/app/tests/test.js:9:80) at Client.emit (events.js:194:15) at WebSocketConnection.triggerReady (/rbd/pnpm-volume/1ca3098b-affb-4b93-b7e8-fcd8a4a14bd0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:125:17) at WebSocketConnection.checkIfReady (/rbd/pnpm-volume/1ca3098b-affb-4b93-b7e8-fcd8a4a14bd0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:141:61) at GuildCreateHandler.handle (/rbd/pnpm-volume/1ca3098b-affb-4b93-b7e8-fcd8a4a14bd0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/packets/handlers/GuildCreate.js:13:31) at WebSocketPacketManager.handle (/rbd/pnpm-volume/1ca3098b-affb-4b93-b7e8-fcd8a4a14bd0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65) at WebSocketConnection.onPacket (/rbd/pnpm-volume/1ca3098b-affb-4b93-b7e8-fcd8a4a14bd0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35) at WebSocketConnection.onMessage (/rbd/pnpm-volume/1ca3098b-affb-4b93-b7e8-fcd8a4a14bd0/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17) at WebSocket.onMessage (/rbd/pnpm-volume/1ca3098b-affb-4b93-b7e8-fcd8a4a14bd0/node_modules/.registry.npmjs.org/ws/6.2.1/node_modules/ws/lib/event-target.js:120:16) at WebSocket.emit (events.js:189:13) sir how to fix the.

GuildMemberBoost Event problem

Once I Client.emit the event it works perfectly, but when I have it in my code normally like Client.on and someone boosts the server, it doesn't work, I tried to console.log maybe it's the database problem but it doesn't even emit the event when someone boost, (it doesn't log anything) so I don't really know why it is not working if it is possible to contact by any way that will be appreciated, thank you have a nice day

messagePinned Only emits for messages sent after the client is logged in.

messagePinned Only emits for messages sent after the client is logged in. It should also emit for messages sent before the client logs in.

Example:

Message A is sent before the client logged in. The bot logs in and a user pins Message A. The bot does nothing with that pinned message.

The bot logs in. Message A is sent. Message A is pinned & emitted.

Presence Update file to modify.

`"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator"throw"); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (
) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
/**

  • @handler Presence Events
  • @related presenceUpdate
    /
    function handlePresenceUpdateEvent(client, oldPresence, newPresence) {
    return __awaiter(this, void 0, void 0, function () {
    return __generator(this, function (_a) {
    if (!oldPresence)
    return [2 /return/];
    /
    *
    * @event guildMemberOffline
    * @description Emitted when a member becomes offline.
    * @param {DJS:GuildMember} member The member who became offline.
    * @param {DJST:Status} oldStatus The old member status, it can be "dnd", "idle" or "online".
    * @example
    * client.on("guildMemberOffline", (member, oldStatus) => {
    * console.log(member.user.tag+" became offline!");
    * });
    /
    if (oldPresence.status !== 'offline' && newPresence.status === 'offline') {
    return [2 /return/, client.emit('guildMemberOffline', newPresence.member, oldPresence.status)];
    }
    /
    *
    * @event guildMemberOnline
    * @description Emitted when a member becomes online, dnd or idle.
    * @param {DJS:GuildMember} member The member who became online.
    * @param {DJST:Status} newStatus The new member status, it can be "dnd", "idle" or "online".
    * @example
    * client.on("guildMemberOnline", (member, newStatus) => {
    * console.log(member.user.tag+" was offline and is now "+newStatus+"!");
    * });
    */
    if (oldPresence.status === 'offline' && newPresence.status !== 'online') {
    return [2 /return/, client.emit('guildMemberOnline', newPresence.member, newPresence.status)];
    }
    return [2 /return/];
    });
    });
    }
    exports.handlePresenceUpdateEvent = handlePresenceUpdateEvent;
    `

Installation failed

Can't install it using npm i discord-logs , it's always giving error , even when I download the package through repo ,still can't install it . Please fix it ... error is like this :

npm ERR! syscall spawn git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://[email protected]/discordjs/discord.js.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\anksark\AppData\Roaming\npm-cache\_logs\2020-04-16T11_13_21_994Z-debug.log```

and in the log file :

```verbose stack Error: spawn git ENOENT
20 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
20 verbose stack     at onErrorNT (internal/child_process.js:469:16)
20 verbose stack     at processTicksAndRejections (internal/process/task_queues.js:84:21)
21 verbose cwd C:\Users\anksark\Documents\WeirdTrexy
22 verbose Windows_NT 10.0.18363
23 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "./discord-logs"
24 verbose node v12.16.1
25 verbose npm  v6.13.4
26 error code ENOENT
27 error syscall spawn git
28 error path git
29 error errno ENOENT
30 error enoent Error while executing:
30 error enoent undefined ls-remote -h -t ssh://[email protected]/discordjs/discord.js.git
30 error enoent
30 error enoent
30 error enoent spawn git ENOENT
31 error enoent This is related to npm not being able to find a file.
32 verbose exit [ 1, true ]```

events handler

In every events it coming undefined instedof objects

code: (event handler)

const fs = require("fs");
const allevents = [];
module.exports = async (client) => {

    const logs = require("discord-logs");
    logs(client, {
        debug: true
    })
    try {
        try {
            const stringlength = 69;
            console.log("\n")
            console.log(`     ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.brightGreen)
            console.log(`     ┃ `.bold.brightGreen + " ".repeat(-1 + stringlength - ` ┃ `.length) + "┃".bold.brightGreen)
            console.log(`                    The Events handler is starting [events.js]           `.bold.blue)
            console.log(`     ┃ `.bold.brightGreen + " ".repeat(-1 + stringlength - ` ┃ `.length) + "┃".bold.brightGreen)
            console.log(`     ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.brightGreen)
        } catch {
            /* */ }
        let amount = 0;
        const load_dir = (dir) => {
            const event_files = fs.readdirSync(`./events/${dir}`).filter((file) => file.endsWith(".js"));
            for (const file of event_files) {
                try {
                    const event = require(`../events/${dir}/${file}`)
                    let eventName = file.split(".")[0];
                    allevents.push(eventName);
                    client.on(eventName, event.bind(null, client));
                    amount++;
                } catch (e) {
                    console.log(e)
                }
            }
        }
        await ["client", "guild"].forEach(e => load_dir(e));
        console.log(`${amount} Events Loaded`.brightGreen);
        try {
            const stringlength2 = 69;
            console.log("\n")
            console.log(`     ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓`.bold.yellow)
            console.log(`     ┃ `.bold.yellow + " ".repeat(-1 + stringlength2 - ` ┃ `.length) + "┃".bold.yellow)
            console.log(`     ┃ `.bold.yellow + `Logging into the BOT...`.bold.yellow + " ".repeat(-1 + stringlength2 - ` ┃ `.length - `Logging into the BOT...`.length) + "┃".bold.yellow)
            console.log(`     ┃ `.bold.yellow + " ".repeat(-1 + stringlength2 - ` ┃ `.length) + "┃".bold.yellow)
            console.log(`     ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛`.bold.yellow)
        } catch {
            /* */ }
    } catch (e) {
        console.log(String(e.stack).bgRed)
    }
};

event: (guildMemberRoleAdd)

module.exports = (member, role) => {
    console.log(member.user.tag+" acquired the role: "+ `${role.name}`);
}```

console output

channelUpdate event handler registered.
guildUpdate event handler registered.
roleUpdate event handler registered.
guildMemberUpdate event handler registered.
userUpdate event handler registered.
messageUpdate event handler registered.
presenceUpdate event handler registered.
voiceStateUpdate event handler registered

NIKU [.]#0746 acquired the role: undefined
NIKU [.]#0746 acquired the role: undefined


And it showing me client name instead of the target name

guildMemberNicknameUpdate event not triggering

const logs = require("discord-logs");
logs(client, {
  debug: true,
});
client.on("guildMemberNicknameUpdate", (member, oldNickname, newNickname) => {
  console.log(member.user.tag + "'s nickname is now " + newNickname);
});

The event doesn't fire on member.user.tag changing his name.
No error is shown

Cannot use discord-logs with a custom client

Hello there!

I created a custom client (that actually extends Discord.Client). I want it to use discord-logs.

import { Client, ClientOptions } from 'discord.js';
import addDiscordLogsFramework from 'discord-logs';

class DatadropClient extends Client {
    constructor(options: ClientOptions) {
        super(options);
        addDiscordLogsFramework(this);
    }
}

Unfortunately, it seems that the library throws a TypeError whenever I try to pass it the this parameter.
I receive the following report from my logger:

H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:47
        intents = new discord_js_1.Intents(client.options.intents);
                  ^

TypeError: discord_js_1.Intents is not a constructor
    at H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:47:19
    at step (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:33:23)
    at Object.next (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:14:53)
    at H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:4:12)
    at module.exports (H:\git\personal\datadrop\node_modules\discord-logs\lib\index.js:41:54)
    at new DatadropClient (H:\git\personal\datadrop\build\src\datadrop.js:67:36)
    at Object.<anonymous> (H:\git\personal\datadrop\build\index.js:30:16)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)

I checked your issues and saw that #171 and #169 talk about it. Both are closed by #172. Unfortunately, no release version has been made. Would it be possible to publish [email protected] if possible?

Does it work on event handlers?

I have this event handler code with the custom guildChannelPermissionsUpdate event.

const Discord = require("discord.js");

module.exports = {
    name: "guildChannelPermissionsUpdate",
    async execute(channel, oldPermissions, newPermissions, client) {
        let log = process.env.LOG_CHANNEL
    client.channels.cache.get(log).send(
      new Discord.MessageEmbed()
        .setColor("RANDOM")
        .setThumbnail(client.user.displayAvatarURL())
        .setAuthor(
          "Channel Permissions Updated",
          client.user.displayAvatarURL()
        )
        .setDescription("A channel's permissions have been updated.")
        .addField(`Channel Name`, channel.name)
        .addField("Channel ID", `\`${channel.id}\``)
        .setTimestamp()
    );
    }
}

objects issue

const embed = new MessageEmbed()
        .setColor(role.guild.me.displayHexColor)
        .setTimestamp()
        .setTitle(`Role Added`)

        if(!channel) return;

        channel.send({embeds: [
            embed.addField(`Added by:`, `**${member.user.tag}** (${member})`, true)
            .addField(`Role:`, `${role}`, true)
            .addField(`Added to: `, `${role.}`, true)

        ]}).catch((err) => {
            return console.log(err)
        });```
        
        on the field (Added to) when i o ```role.member.user.tag``` is shows me undefined

[Feature request] Invite event

Is there anyway you can add invite event. In which we can use them to get who invited the member
client.on('memberJoin', (member, invite) => {
console.log(member.user.tag+' invited by '+invite.creator)
})
Something like this will help us alot.

Memory will goes overload sometimes (more often)

Hey, how many events are you using? I check 2-3 hours and the memory increased to 1,3GB and the bot is private (one-server only)
Why?

EDIT

possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.

image

voiceChannelUnmute

In voice channel Unmute, you have written

client.on("voiceChannelMute", (member, oldMuteType) => {
console.log(member.user.tag+" become unmuted!");
});

But it should be:
client.on("voiceChannelUnmute", (member, oldMuteType) => {
console.log(member.user.tag+" become unmuted!");
});
image

issue in voiceStreamingStart

when someone start a streaming he trigger the event 3 times
image

this is my code

const logs = require('discord-logs');
const { Message } = require('discord.js');

module.exports = class {

constructor(client) {
    this.client = client;
    logs(client);
}

async run(member, voiceChannel) {

    let channel = this.client.channels.cache.get('724348520923922574');

    channel.send(`hey, ${member.user.tag} is now live in ${voiceChannel} streaming ${member.user.presence.activities[0]}`)

}

};

Ghost Ping?

Hello.
This library interests me, but are there any plans to add an ghostPing event?
Thank you.

Suggestion: ChannelNameUpdate event

client.on('ChannelNameUpdate', async(oldName, NewName) => {
console.log('The channel name has been updated from ' + oldName + ' to ' + newName)
}

gets triggered when a channel name is changed!

PermissionsOverwrites

Hey, is there a possible way to add in "guildChannelPermissionsUpdate" permissions updated list like

added MANAGE_EMOJIS permissions
deleted SEND_MESSAGES permissions

something like this.

voiceChannelJoin not working

The following code is not working:

const client = require('../index');
const { MessageEmbed } = require('discord.js');
const { server_log } = require('.//../channel.json');

// Joined VC
client.on('voiceChannelJoin', (member, channel) => {

	const LogChannel = client.channels.cache.get(server_log);
	const VCJoined = new MessageEmbed()
		.setTitle('Voice Channel Joined')
		.setColor('#2F3136')
		.setDescription(member.user.tag + ' joined ' + `${channel}` + '!');

	return LogChannel.send({
		embeds: [VCJoined],
	});

});

I am calling this file through the following code:

require('./events/voiceChannelJoin');

But Powershell gave the following output instead:

node:internal/modules/cjs/loader:936
  throw err;
  ^

Require stack:
- F:\Discord bot packages\3rd\index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (F:\Discord bot packages\3rd\index.js:32:1)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'F:\\Discord bot packages\\3rd\\index.js' ]
}

Anyone please help

module isnt installing with windows

when i using glitch its okey there is no problem but when i using windows i get this error my every project its not installing... i dont know why ? can u tell me how can i fix this
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.