Discord dashboard
https://sourceb.in/D3ZeMpa8n6
https://sourceb.in/lwjX82jY39
Anyone know how to fix this? make it to where my bot will update its counts when it joines servers
Just having trouble with this
4 Replies
@Helpers
I can't speak to the
.ejs
code I don't use that much. Your home.js
file doesn't implement Client
correctly. Somewhere in your code you'll new to create a new client:
You can then pass that instantiation of the object to ther files in your project to make the client
accessible. i.e client.guilds.cache.size
.
The discord.js guide has a really simple walkthrough to get the skeleton setup or you could use something like the sapphire framework which sets up the router (might be a plugin the docs explain tho) and dependency injection for you (container.client
).
https://discordjs.guide/creating-your-bot/main-file.html
https://www.sapphirejs.dev/docs/Guide/getting-started/getting-started-with-sapphire
https://www.sapphirejs.dev/docs/Guide/additional-information/using-and-extending-container
https://www.sapphirejs.dev/docs/Documentation/api-plugins/modules/sapphire_plugin_apidiscord.js Guide
Imagine a guide... that explores the many possibilities for your discord.js bot.
Sapphire Framework
Getting started with Sapphire | Sapphire
To install Sapphire, you need to install both discord.js and
Sapphire Framework
Using and extending container | Sapphire
The container is a way in which Sapphire achieves Dependency Injection. This is a very useful feature, since it
ive got my client here
Then that’s the client you have to pass to use
client.guilds.cache.size
.
Change your line to const { client } = require(‘./pathToThisFile’)