use of com.discordbolt.api.command.exceptions.CommandPermissionException in project BoltBot by DiscordBolt.
the class Playlist method addContributor.
public void addContributor(IUser requestor, IUser contributor) throws CommandStateException, CommandPermissionException {
if (!ownerID.equals(requestor.getLongID()))
throw new CommandPermissionException("You are not allowed to add contributors to " + this.getTitle() + ".");
if (contributors.contains(contributor.getLongID()))
throw new CommandStateException(contributor.getName() + " is already a contributor to " + this.getTitle() + ".");
contributors.add(contributor.getLongID());
PlaylistManager.writePlaylistFile(this);
}
Aggregations