Had to add bot to new server and change over some ID's and having issues with manage roles

if (message.channel.type == 1) {
const guild = client.guilds.cache.get('Server ID here');
const member = await guild.members.fetch(message.author.id);
LOG(member.user.username + " : Dm received")
if (!member.manageable) {
if (message.channel.type == 1) {
const guild = client.guilds.cache.get('Server ID here');
const member = await guild.members.fetch(message.author.id);
LOG(member.user.username + " : Dm received")
if (!member.manageable) {
My bot detects when a user sends a DM and then checks if it can manage the roles for this user, on the other server this worked fine i have changed over the server ID on the second line and changed nothing else. the issue is member.managable is returning false and im not sure why, the user im testing with has no roles with permissions and the bot has correct permissions and intentions to my knowledge. Any tests i can do to check what could be wrong or anyone see an error in the code?
6 Replies
d.js toolkit
d.js toolkit7mo ago
- 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!
Fxkitt
Fxkitt7mo ago
"@types/node": "^18.0.6", "discord.js": "^14.9.0",
Syjalo
Syjalo7mo ago
Is that member the server owner?
Fxkitt
Fxkitt7mo ago
nope its a test account i just added
Syjalo
Syjalo7mo ago
Then the bot just dont't have permissions in that server
Fxkitt
Fxkitt7mo ago
hmm i gave it a administrator role and it had admin selected for the url maybe ill try reinvite it