Fhyrox
Fhyrox
DIAdiscord.js - Imagine an app
Created by Fhyrox on 5/1/2024 in #djs-questions
status
client.user.setStatus(PresenceUpdateStatus.Invisible); ^ TypeError: Cannot read properties of null (reading 'setStatus') at Object.<anonymous> (C:\Users\kycok\Desktop\V14 deneme\index.js:48:13) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) at node:internal/main/run_main_module:23:47 Node.js v18.17.1
2 replies
DIAdiscord.js - Imagine an app
Created by Fhyrox on 9/16/2023 in #djs-questions
mongodb error
events/messageCreate.js
const { Events } = require('discord.js');
const model = require('../schema/profileschema')

module.exports = {
name: Events.MessageCreate,
execute(Message) {
let profileData;
try {
profileData = model.findOne({ userId: Message.author.id });
if (!profileData) {
profileData = model.create({
userId: Message.author.id,
});
}
} catch(err) {
console.log(err)
}`
}
}
const { Events } = require('discord.js');
const model = require('../schema/profileschema')

module.exports = {
name: Events.MessageCreate,
execute(Message) {
let profileData;
try {
profileData = model.findOne({ userId: Message.author.id });
if (!profileData) {
profileData = model.create({
userId: Message.author.id,
});
}
} catch(err) {
console.log(err)
}`
}
}
const { EmbedBuilder } = require("discord.js"); const model = require("../schema/profileschema"); const profileData = require('../eventler/messageCreate') param.js
module.exports = {
name: 'param',
description: 'Param komiti.',
execute(message, args, profileData) {
const {para, banka} = profileData;
const username = message.author.username;

const exampleEmbed = new EmbedBuilder()
.setColor(0x0099FF)
.setURL('https://discord.js.org/')
.setAuthor({ name: `${message.author.username} adlı kişinin bakiye bilgileri.`, iconURL: `${message.author.displayAvatarURL()}`})
.setDescription('Some description here')
.setThumbnail(message.author.displayAvatarURL())
.addFields(
{ name: 'Para', value: para, inline: true },
{ name: 'Banka', value: banka, inline: true },
)
.setTimestamp()

message.channel.send({ embeds: [exampleEmbed] });
},
};
module.exports = {
name: 'param',
description: 'Param komiti.',
execute(message, args, profileData) {
const {para, banka} = profileData;
const username = message.author.username;

const exampleEmbed = new EmbedBuilder()
.setColor(0x0099FF)
.setURL('https://discord.js.org/')
.setAuthor({ name: `${message.author.username} adlı kişinin bakiye bilgileri.`, iconURL: `${message.author.displayAvatarURL()}`})
.setDescription('Some description here')
.setThumbnail(message.author.displayAvatarURL())
.addFields(
{ name: 'Para', value: para, inline: true },
{ name: 'Banka', value: banka, inline: true },
)
.setTimestamp()

message.channel.send({ embeds: [exampleEmbed] });
},
};
3 replies