@Override public long getLongID() { return guild.getLongID(); } }
/** * Retourne true si l'utilisateur a les droits nécessaires, false le cas échéant * @param message Message reçu * @return true si l'utilisateur a les droits nécessaires, false le cas échéant */ protected boolean isUserHasEnoughRights(IMessage message){ return ! message.getChannel().isPrivate() && (message.getAuthor().getLongID() == Constants.authorId || message.getAuthor().getPermissionsForGuild(message.getGuild()).contains(Permissions.MANAGE_SERVER) || message.getChannel().getModifiedPermissions(message.getAuthor()).contains(Permissions.MANAGE_SERVER)); }
public MessageEvent(IMessage message) { super(message.getChannel()); this.message = message; this.messageID = message.getLongID(); }
/** * Gets the channel the messages were sent in, or null if no messages are present. * * @return The channel the messages were sent in, or null if no messages are present. */ public IChannel getChannel() { return (backing.length == 0) ? null : backing[0].getChannel(); }
/** * Gets the author of the message. * * <p>This is equivalent to <code>getMessage().getAuthor()</code> * * @return The author of the message. */ public IUser getAuthor() { return message == null ? null : message.getAuthor(); }
@Override public IGuild getGuild() { return channel.getGuild(); }
@Override public String getName() { return recipient.getName(); }
public AudioManager(IGuild guild) { this.guild = guild; client = guild.getClient(); }
@Override public String mention() { return recipient.mention(); }
@Override public IMessage getMessageByID(long messageID) { IMessage message = guildCache.findResult((guildID, guild) -> guild.getMessageByID(messageID)); if (message == null) message = privateChannels.findResult((channelID, channel) -> channel.getMessageByID(messageID)); return message; }
/** * Gets the number of users who have reacted with the same reaction. * * <p>This is equivalent to <code>getReaction().getCount()</code> * * @return The number of users who have reacted with the same reaction. */ public int getCount() { return reaction.getCount(); } }
/** * Gets whether the given "permissions number" contains the permission. * * <p>Equivalent to <code>hasPermission(number, true)</code> * * @param permissionsNumber The raw permissions number. * @return Whether the given permissions number contains the permission. */ public boolean hasPermission(int permissionsNumber) { return hasPermission(permissionsNumber, true); }
/** * Sets the CACHED verification level of the guild. * * @param verification The verification level. */ public void setVerificationLevel(int verification) { this.verification = VerificationLevel.get(verification); }
/** * Sets the CACHED permissions by the raw permissions number. * * @param permissions The raw permissions number. */ public void setPermissions(int permissions) { this.permissions = Permissions.getAllowedPermissionsForNumber(permissions); }
public VoiceDisconnectedEvent(IGuild guild, Reason reason) { super(guild, guild.getConnectedVoiceChannel()); this.reason = reason; }
public CategoryEvent(ICategory category) { super(category.getGuild()); this.category = category; }
public RoleEvent(IRole role) { super(role.getGuild()); this.role = role; }
public GuildUnavailableEvent(IGuild guild) { super(guild); this.id = guild.getLongID(); }