default RestAction<List<Message>> getPinnedMessages() Route.CompiledRoute route = Route.Messages.GET_PINNED_MESSAGES.compile(getId()); return new RestAction<List<Message>>(getJDA(), route)
default RestAction<Void> sendTyping() Route.CompiledRoute route = Route.Channels.SEND_TYPING.compile(getId()); return new RestAction<Void>(getJDA(), route)
@Override public String getJumpUrl() { return String.format("https://discordapp.com/channels/%s/%s/%s", getGuild() == null ? "@me" : getGuild().getId(), getChannel().getId(), getId()); }
Route.CompiledRoute route = Route.Messages.REMOVE_PINNED_MESSAGE.compile(getId(), messageId); return new RestAction<Void>(getJDA(), route)
Route.CompiledRoute route = Route.Messages.DELETE_MESSAGE.compile(getId(), messageId); return new AuditableRestAction<Void>(getJDA(), route) { @Override
Route.CompiledRoute route = Route.Messages.ADD_PINNED_MESSAGE.compile(getId(), messageId); return new RestAction<Void>(getJDA(), route)
/** * Creates a new PaginationAction instance * * @param reaction * The target {@link net.dv8tion.jda.core.entities.MessageReaction MessageReaction} */ public ReactionPaginationAction(MessageReaction reaction) { super(reaction.getJDA(), Route.Messages.GET_REACTION_USERS.compile(reaction.getChannel().getId(), reaction.getMessageId(), getCode(reaction)), 1, 100, 100); this.reaction = reaction; }
Route.CompiledRoute route = Route.Messages.SEND_MESSAGE.compile(getId()); return new MessageAction(getJDA(), route, this).embed(embed);
Route.CompiledRoute route = Route.Messages.GET_MESSAGE_HISTORY.compile(channel.getId()).withQueryParams("around", messageId); return new MessageRetrieveAction(route, channel);
Route.CompiledRoute route = Route.Messages.GET_MESSAGE_HISTORY.compile(channel.getId()).withQueryParams("before", messageId); return new MessageRetrieveAction(route, channel);
public MessagePaginationAction(MessageChannel channel) { super(channel.getJDA(), Route.Messages.GET_MESSAGE_HISTORY.compile(channel.getId()), 1, 100, 100); if (channel.getType() == ChannelType.TEXT) { TextChannel textChannel = (TextChannel) channel; if (!textChannel.getGuild().getSelfMember().hasPermission(textChannel, Permission.MESSAGE_HISTORY)) throw new InsufficientPermissionException(Permission.MESSAGE_HISTORY); } this.channel = channel; }
Route.CompiledRoute route = Route.Messages.GET_MESSAGE_HISTORY.compile(channel.getId()).withQueryParams("after", messageId); return new MessageRetrieveAction(route, channel);
Route.CompiledRoute route = Route.Messages.SEND_MESSAGE.compile(getId()); return new MessageAction(getJDA(), route, this).apply(msg);
Checks.notNull(newEmbed, "MessageEmbed"); Route.CompiledRoute route = Route.Messages.EDIT_MESSAGE.compile(getId(), messageId); return new MessageAction(getJDA(), route, this).embed(newEmbed);
Checks.notNull(newContent, "message"); Route.CompiledRoute route = Route.Messages.EDIT_MESSAGE.compile(getId(), messageId); return new MessageAction(getJDA(), route, this).apply(newContent);
Checks.check(text.length() <= 2000, "Provided text for message must be less than 2000 characters in length"); Route.CompiledRoute route = Route.Messages.SEND_MESSAGE.compile(getId()); if (text instanceof StringBuilder) return new MessageAction(getJDA(), route, this, (StringBuilder) text);
Checks.isSnowflake(messageId, "Message ID"); Route.CompiledRoute route = Route.Messages.GET_MESSAGE.compile(getId(), messageId); return new RestAction<Message>(getJDA(), route)
Checks.check(newContent.length() <= 2000, "Provided newContent length must be 2000 or less characters."); Route.CompiledRoute route = Route.Messages.EDIT_MESSAGE.compile(getId(), messageId); if (newContent instanceof StringBuilder) return new MessageAction(getJDA(), route, this, (StringBuilder) newContent);
Checks.notNull(fileName, "fileName"); Route.CompiledRoute route = Route.Messages.SEND_MESSAGE.compile(getId()); return new MessageAction(getJDA(), route, this).apply(message).addFile(data, fileName);
throw new UnsupportedOperationException("Cannot send a private message between bots."); final Route.CompiledRoute route = Route.Messages.SEND_MESSAGE.compile(channel.getId()); final MessageAction action = new MessageAction(channel.getJDA(), route, channel, builder); return action.tts(isTTS).embed(embed).nonce(nonce);