/** * The JDA instance of this Reaction * * @return The JDA instance of this Reaction */ public JDA getJDA() { return channel.getJDA(); }
/** * The corresponding JDA instance for this MessageHistory * * @return The corresponding JDA instance */ public JDA getJDA() { return channel.getJDA(); }
protected MessageRetrieveAction(Route.CompiledRoute route, MessageChannel channel) { super(channel.getJDA(), route); this.channel = channel; }
public ReceivedMessage( long id, MessageChannel channel, MessageType type, boolean fromWebhook, boolean mentionsEveryone, TLongSet mentionedUsers, TLongSet mentionedRoles, boolean tts, boolean pinned, String content, String nonce, User author, OffsetDateTime editTime, List<MessageReaction> reactions, List<Attachment> attachments, List<MessageEmbed> embeds) { super(content, nonce, tts); this.id = id; this.channel = channel; this.type = type; this.api = (channel != null) ? (JDAImpl) channel.getJDA() : null; this.fromWebhook = fromWebhook; this.mentionsEveryone = mentionsEveryone; this.pinned = pinned; this.author = author; this.editedTime = editTime; this.reactions = Collections.unmodifiableList(reactions); this.attachments = Collections.unmodifiableList(attachments); this.embeds = Collections.unmodifiableList(embeds); this.mentionedUsers = mentionedUsers; this.mentionedRoles = mentionedRoles; }
return new RestAction<List<Message>>(getJDA(), route)
return new RestAction<Void>(getJDA(), route)
return new RestAction<Void>(getJDA(), route)
return new AuditableRestAction<Void>(getJDA(), route) { @Override protected void handleResponse(Response response, Request<Void> request)
return new RestAction<Void>(getJDA(), route)
return new MessageAction(getJDA(), route, this).embed(embed);
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; }
final long maxSize = getJDA().getSelfUser().getAllowedFileSize(); Checks.check(data.length <= maxSize, "File is too big! Max file-size is %d bytes", maxSize); return sendFile(new ByteArrayInputStream(data), fileName, message);
return new MessageAction(getJDA(), route, this).apply(msg);
return new MessageAction(getJDA(), route, this).embed(newEmbed);
return new MessageAction(getJDA(), route, this).apply(newContent);
return new RestAction<Void>(getJDA(), route)
return new MessageAction(getJDA(), route, this).apply(message).addFile(data, fileName);
case PRIVATE: final PrivateChannel priv = (PrivateChannel) channel; if (priv.getUser().isBot() && channel.getJDA().getAccountType() == AccountType.BOT) throw new UnsupportedOperationException("Cannot send a private message between bots."); final MessageAction action = new MessageAction(channel.getJDA(), route, channel, builder); return action.tts(isTTS).embed(embed).nonce(nonce);