getting guild object
anyone knows how can I check if any kind of event happened and get the guild object?
my bot only works on guilds so direct messages can be ignored.
3 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!What exactly do you mean by "any kind of event"
You can listen to specific events and if they happened in a guild, they will have a reference to that guild in some way
You're going to need to know which event it is to know which properties you're actually getting as arguments
just when an event happens i want to check if my api is online - like a middleware so if not i can return early and notify the server owner once.