Get a guild object inside an express API route #9748
Replies: 1 comment
-
Better join the support Discord server for support questions like these. The GitHub is for issues and bugs with the library and its development, not for questions about it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to make my bot do some changes to our server based on a request to our API endpoint.
in the index.js I am starting the server and the bot, then exporting the bot to access the client on the API route.
index.js
In the route I want the bot to make changes in:
create.js
This gives me a type error
TypeError: Cannot read properties of undefined (reading 'create')
The guild I fetch is an object that only has a few properties and I can't access properties like roles, channels...etc
How can I change the fetched guild into an object to access roles and other properties and methods?
Beta Was this translation helpful? Give feedback.
All reactions