Comments (7)
Role[] is an array of Roles. This allows you to set multiple roles to a user
from javacord.
Okay, but my code is incorrect when i apply that
@SuppressWarnings({ "unchecked", "rawtypes" }) ArrayList<Role> role = new ArrayList(); role.add(Role[]); message.delete(); message.reply("GG à toi "+message.getAuthor().getMentionTag()+", tu as trouvé la phrase magique..."); server.updateRoles(message.getAuthor(), role[6]);
It's correct ?
from javacord.
No,that is not correct. When you supply a index to a array, [int], it represents the element of that position. You are trying to put a role object instead of the entire array. The correct way is updateRoles(author,role)
from javacord.
EDIT: Turn the list to an array first
from javacord.
So,
ArrayList<Role> role = new ArrayList();
role.add(6);
server.updateRoles(message.getAuthor(), role[]);
Or
ArrayList<Role> role = new ArrayList();
role.add(Role[6]);
server.updateRoles(message.getAuthor(), role[]);
It's correct? I think not...
from javacord.
No,you need to convert the ArrayList to an array. This is simple java
from javacord.
Oh, okay thanks you
from javacord.
Related Issues (20)
- Move from deprecated channel_id to new interaction channel field
- Couldn't handle packet of type VOICE_STATE_UPDATE
- Add voice message support to text channel
- Add super reactions
- Slash Commands issue HOT 11
- Replacement/just removal and deprecation of `getDiscriminatedName ` HOT 8
- Add role flags HOT 1
- Add attachment flags HOT 1
- Add the message author id to message reaction events HOT 1
- Add user avatar decorations
- SlashCommandOptionChoice#getLongValue returns a empty optional despite a long value being present on DAPI HOT 2
- `ServerThreadChannelCreateListener` dispatching twice.
- Parameters are ignored when requesting archived threads
- Look through the code for non thread safe collections
- Add default select menu values HOT 1
- Add support for premium app subscriptions
- Add resolved field to message components
- Fix Embed* implementation methods returning null instead of optional
- Continuous switching between the voice channels.
- Ability to set message flags for any message to send (not only for interaction messages)
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 javacord.