Aiwoz
Aiwoz
DIAdiscord.js - Imagine an app
Created by Aiwoz on 12/21/2023 in #djs-questions
Message.content don't work
I'm so sorry. 😭
6 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 12/21/2023 in #djs-questions
Message.content don't work
Ah, yes, I thought it was just GuildMessages
6 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 12/21/2023 in #djs-questions
Message.content don't work
Hey, In the embed, it is marked : Message:
client.on(`messageCreate`, async message => {
if (message.author.bot) {
return;
}
const messageLog = new EmbedBuilder()
.setColor(`#4CE1FE`)
.setTitle(`Message envoyé`)
.setDescription(`Message: ${message.content} \n Salon: <#${message.channel.id}> \n Par: ${message.author.displayName} \n ID: ${message.author.id}`)
.setTimestamp();
client.channels.cache.get(logsBot).send({embeds: [messageLog]});
});
client.on(`messageCreate`, async message => {
if (message.author.bot) {
return;
}
const messageLog = new EmbedBuilder()
.setColor(`#4CE1FE`)
.setTitle(`Message envoyé`)
.setDescription(`Message: ${message.content} \n Salon: <#${message.channel.id}> \n Par: ${message.author.displayName} \n ID: ${message.author.id}`)
.setTimestamp();
client.channels.cache.get(logsBot).send({embeds: [messageLog]});
});
6 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 12/10/2023 in #djs-voice
Node.JS V20.X with Oups
Ok, sorry, thank you and have a nice day. 😉
6 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 12/10/2023 in #djs-voice
Node.JS V20.X with Oups
Yes but what is this not compatible ?
6 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 12/10/2023 in #djs-voice
Node.JS V20.X with Oups
It's not functionnal. :/
6 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 12/10/2023 in #djs-voice
Node.JS V20.X with Oups
I tried a while ago with Node.JS 20.x when Node.JS 18 was supported.
6 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/30/2023 in #djs-questions
Audit Logs : VoiceStatUpdates
Thank you. ^^
13 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/30/2023 in #djs-questions
Audit Logs : VoiceStatUpdates
With if(action) ?
13 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/30/2023 in #djs-questions
Audit Logs : VoiceStatUpdates
Thank you but how can you tell if he leaves the voice or if he gets disconnected?
13 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/30/2023 in #djs-questions
Audit Logs : VoiceStatUpdates
if (oldChannel && !newChannel) {



const { AuditLogEvent } = require('discord.js');

const fetchedLogs = await (oldState, newState).guild.fetchAuditLogs({
limit: 1,
type: 'MEMBER_DISCONNECT',
});

const log = fetchedLogs.entries.first();
const { executor } = log;

console.log(executor);
if (oldChannel && !newChannel) {



const { AuditLogEvent } = require('discord.js');

const fetchedLogs = await (oldState, newState).guild.fetchAuditLogs({
limit: 1,
type: 'MEMBER_DISCONNECT',
});

const log = fetchedLogs.entries.first();
const { executor } = log;

console.log(executor);
13 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
Thank you and have a nice day or night if you are in E.U. 😴
16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
😉
16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
Oops, I forgot. 🙂
16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
Ok, thanks
16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
Ah, but is it better to use Audit Logs for the other logs? (When a member leaves or joins the server and when he leaves or joins a voice room.
16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
Yes, but how can I check if he is the one changing the channel or if he is being moved.
16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
My code :
const { EmbedBuilder } = require(`discord.js`);
const { log_channel } = require(`../config.json`);

module.exports = {
name: 'voiceStateUpdate',
execute(oldState, newState) {
const oldChannel = oldState.channel;
const newChannel = newState.channel;

if (oldChannel === newChannel) return;

if (!oldChannel && newChannel) {
console.log(`${newState.member.user.displayName} (${newState.member.user.id}) a rejoint le salon vocal ${newChannel.name}.`);
const joinLog = new EmbedBuilder()
.setColor(`#00FF00`)
.setTitle(`Un membre vient de rejoint un salon vocal.`)
.setDescription(`Salon: ${newChannel.name} \n Membre: ${newState.member.user.displayName} \n ID: ${newState.member.user.id}`)
.setTimestamp();
newState.guild.channels.cache.get(log_channel).send({embeds: [joinLog]});
}
if (oldChannel && !newChannel) {
console.log(`${oldState.member.user.displayName} (${oldState.member.user.id}) a quitté le salon vocal ${oldChannel.name}.`);
const leaveLog = new EmbedBuilder()
.setColor(`#FF0000`)
.setTitle(`Un membre vient de quitter un salon vocal.`)
.setDescription(`Salon: ${oldChannel.name} \n Membre: ${oldState.member.user.displayName} \n ID: ${oldState.member.user.id}`)
.setTimestamp();
oldState.guild.channels.cache.get(log_channel).send({embeds: [leaveLog]});
}
if (oldChannel && newChannel) {
console.log(`${newState.member.user.displayName} (${newState.member.user.id}) a changé de salon vocal. ${oldChannel.name} => ${newChannel.name}`);
const switchLog = new EmbedBuilder()
.setColor(`#00FF00`)
.setTitle(`Un membre vient de changer de salon vocal.`)
.setDescription(`Ancien Salon: ${oldChannel.name} \n Nouveau Salon: ${newChannel.name} \n Membre: ${newState.member.user.displayName} \n ID: ${newState.member.user.id}`)
.setTimestamp();
newState.guild.channels.cache.get(log_channel).send({embeds: [switchLog]});
}
},
};

const { EmbedBuilder } = require(`discord.js`);
const { log_channel } = require(`../config.json`);

module.exports = {
name: 'voiceStateUpdate',
execute(oldState, newState) {
const oldChannel = oldState.channel;
const newChannel = newState.channel;

if (oldChannel === newChannel) return;

if (!oldChannel && newChannel) {
console.log(`${newState.member.user.displayName} (${newState.member.user.id}) a rejoint le salon vocal ${newChannel.name}.`);
const joinLog = new EmbedBuilder()
.setColor(`#00FF00`)
.setTitle(`Un membre vient de rejoint un salon vocal.`)
.setDescription(`Salon: ${newChannel.name} \n Membre: ${newState.member.user.displayName} \n ID: ${newState.member.user.id}`)
.setTimestamp();
newState.guild.channels.cache.get(log_channel).send({embeds: [joinLog]});
}
if (oldChannel && !newChannel) {
console.log(`${oldState.member.user.displayName} (${oldState.member.user.id}) a quitté le salon vocal ${oldChannel.name}.`);
const leaveLog = new EmbedBuilder()
.setColor(`#FF0000`)
.setTitle(`Un membre vient de quitter un salon vocal.`)
.setDescription(`Salon: ${oldChannel.name} \n Membre: ${oldState.member.user.displayName} \n ID: ${oldState.member.user.id}`)
.setTimestamp();
oldState.guild.channels.cache.get(log_channel).send({embeds: [leaveLog]});
}
if (oldChannel && newChannel) {
console.log(`${newState.member.user.displayName} (${newState.member.user.id}) a changé de salon vocal. ${oldChannel.name} => ${newChannel.name}`);
const switchLog = new EmbedBuilder()
.setColor(`#00FF00`)
.setTitle(`Un membre vient de changer de salon vocal.`)
.setDescription(`Ancien Salon: ${oldChannel.name} \n Nouveau Salon: ${newChannel.name} \n Membre: ${newState.member.user.displayName} \n ID: ${newState.member.user.id}`)
.setTimestamp();
newState.guild.channels.cache.get(log_channel).send({embeds: [switchLog]});
}
},
};

16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 10/23/2023 in #djs-questions
Logs - Discordjs
I couldn't find anything useful in the docs and on the internet.
16 replies
DIAdiscord.js - Imagine an app
Created by Aiwoz on 8/21/2023 in #djs-questions
Discord.JS Temporary ban
No description
5 replies