Comments (3)
The HierarchyException is thrown by addRoleToMember
, before you even call queue. Are you sure that you properly handle exceptions being thrown?
from jda.
The HierarchyException is thrown by
addRoleToMember
, before you even call queue. Are you sure that you properly handle exceptions being thrown?
When I call the method guild.addRoleToMember
it didn't throw any exception.
And the bot did have the permission to manage the role but the roles higher than the bot's role will not work.
And no matter the bot's role is higher or lower than the target the method won't throw the exception.
from jda.
I just tried this again, and it definitely throws an exception:
net.dv8tion.jda.api.exceptions.HierarchyException: Can't modify a role with higher or equal highest role than yourself! Role: Role:highest role(id=280161492307804160)
at net.dv8tion.jda.internal.entities.GuildImpl.checkPosition(GuildImpl.java:2031)
at net.dv8tion.jda.internal.entities.GuildImpl.addRoleToMember(GuildImpl.java:1688)
Since you also called your variable linkedRole
, it might refer to a managed role, in which case the request fails with a failure callback:
[pool-1-thread-11] ERROR RestAction - RestAction queue returned failure: [ErrorResponseException] 50013: Missing Permissions
net.dv8tion.jda.api.exceptions.ContextException
at net.dv8tion.jda.api.exceptions.ContextException.here(ContextException.java:54)
at net.dv8tion.jda.api.requests.Request.<init>(Request.java:77)
at net.dv8tion.jda.internal.requests.RestActionImpl.queue(RestActionImpl.java:203)
at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:573)
at net.dv8tion.jda.api.requests.RestAction.queue(RestAction.java:539)
The same happens if for some reason the position check in JDA fails.
Please give me an easy to reproduce test-scenario, if you still encounter issues. Otherwise, I have to assume this issue is an incorrect handling of exceptions on your end.
from jda.
Related Issues (20)
- First GuildMemberRoleAddEvent or GuildMemberRoleRemoveEvent does not fire HOT 6
- event.getTarget().getMember() returns null in onMessageContextInteraction HOT 2
- Audio WebsSocket Issue HOT 3
- FlatMapRestAction not checking the condition predicate when using RestAction#submit() HOT 1
- Discord JDA loading SlashCommands HOT 1
- event does not send response (GuildMemberJoinEvent)
- ClassCastException/Failed to parse JSON HOT 5
- Can't register Guild command HOT 1
- Modify Bot's Browser or Device HOT 2
- Polls HOT 6
- Make JDA bubble up websocket crashes as ExceptionEvent HOT 1
- add errorresponse 50178 The user account must first be verified HOT 2
- .
- Bot is unable to stream audio on stage in certain scenarios HOT 4
- Commands.slash name on russian HOT 2
- Exception in WS read thread: RSV1 bit of a frame is set unexpectedly HOT 11
- ErrorResponse USER_MUST_BE_VERIFIED Error HOT 3
- ClassNotFoundException: net.dv8tion.jda.api.entities.GuildChannel HOT 2
- Bot can't delete voice channel even with MANAGE_CHANNEL HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jda.