Stev
Stev
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Stev on 6/22/2023 in #djs-questions
shardCreate/ShardingManager with shards: 'auto'?
Right now I've got virtually no logging. Therefore, when I run into issues, it takes me more time than it should to figure out what's happening. I'd just like to log when a shard spawns or is created, how long they take before they're ready (since Client has shardReady), etc.
4 replies
DIAdiscord.js - Imagine an app
Created by Stev on 6/22/2023 in #djs-questions
shardCreate/ShardingManager with shards: 'auto'?
Cheers for the response. I'm just looking to add better logging than what I have now
4 replies
DIAdiscord.js - Imagine an app
Created by Stev on 7/12/2022 in #djs-questions
Stumped with GuildAuditLogsEntry & TypeScript...
Will do!
3 replies
DIAdiscord.js - Imagine an app
Created by Stev on 6/22/2022 in #djs-questions
REST randomly forgets token set with setToken
I will add that now, but it will take ~a day to occur
14 replies
DIAdiscord.js - Imagine an app
Created by Stev on 6/22/2022 in #djs-questions
REST randomly forgets token set with setToken
Everything that requires the REST client simply imports that ^. Works fine for roughly a day until every request rejects and I need to manually restart the PM2 process
14 replies
DIAdiscord.js - Imagine an app
Created by Stev on 6/22/2022 in #djs-questions
REST randomly forgets token set with setToken
Restarting my app manually (via PM2) actually fixes the problem. But if it were to restart, it would just call this again - in which case it would have the token:
// rest.ts

import { REST } from '@discordjs/rest';

// Load required enviroment variables.
const DISCORD_TOKEN = process.env.DISCORD_TOKEN as string;

// Initiate REST.
const rest = new REST().setToken(DISCORD_TOKEN);

export default rest;
// rest.ts

import { REST } from '@discordjs/rest';

// Load required enviroment variables.
const DISCORD_TOKEN = process.env.DISCORD_TOKEN as string;

// Initiate REST.
const rest = new REST().setToken(DISCORD_TOKEN);

export default rest;
14 replies