sachoochoo
sachoochoo
DIAdiscord.js - Imagine an app
Created by sachoochoo on 3/5/2024 in #djs-questions
Deprecation Warning (VSCode)
Getting an issue with the punycode module.
(node:22123) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
(node:22123) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
How to fix?
4 replies
DIAdiscord.js - Imagine an app
Created by sachoochoo on 2/18/2024 in #djs-questions
Bot statuses disappear after a short while
Hey everyone, does anyone by chance know why my bot stops displaying its statuses all together? My statuses are defined in a statuses.js file. Here is my index.js file:
//LOOPS THROUGH DIFFERENT STATUSES EVERY 30 MINUTES
client.on('ready', (c) => {
console.log(`✅ ${c.user.tag} is online!`);
setInterval(() => {
var newStatus = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(newStatus);
}, 1.8e6);
});
//LOOPS THROUGH DIFFERENT STATUSES EVERY 30 MINUTES
client.on('ready', (c) => {
console.log(`✅ ${c.user.tag} is online!`);
setInterval(() => {
var newStatus = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(newStatus);
}, 1.8e6);
});
15 replies
DIAdiscord.js - Imagine an app
Created by sachoochoo on 2/15/2024 in #djs-questions
How to write a JSON file with a list of discord.js statuses and import it into the main index.js?
//index.js
const statuses = [
{ name: "ABC", type: ActivityType.Streaming },
{ name: "DEF", type: ActivityType.Watching },
{ name: "GHI", type: ActivityType.Listening },
{ name: "JKL", type: ActivityType.Playing },
];
client.on('ready', (c) => {
console.log(`✅ ${c.user.tag} is online!`);
setInterval(() => {
var newStatus = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(newStatus);
}, 10000);
});
const statuses = [
{ name: "ABC", type: ActivityType.Streaming },
{ name: "DEF", type: ActivityType.Watching },
{ name: "GHI", type: ActivityType.Listening },
{ name: "JKL", type: ActivityType.Playing },
];
client.on('ready', (c) => {
console.log(`✅ ${c.user.tag} is online!`);
setInterval(() => {
var newStatus = statuses[Math.floor(Math.random() * statuses.length)];
client.user.setActivity(newStatus);
}, 10000);
});
what should I write in my JSON file and how should I implement it? I want to put
const statuses = [
{ name: "ABC", type: ActivityType.Streaming },
{ name: "DEF", type: ActivityType.Watching },
{ name: "GHI", type: ActivityType.Listening },
{ name: "JKL", type: ActivityType.Playing },
];
const statuses = [
{ name: "ABC", type: ActivityType.Streaming },
{ name: "DEF", type: ActivityType.Watching },
{ name: "GHI", type: ActivityType.Listening },
{ name: "JKL", type: ActivityType.Playing },
];
as a seperate file and call it in my main index.js.
26 replies