/** * Creates a new RoleAction instance * * @param route * A {@link net.dv8tion.jda.core.requests.Route.CompiledRoute CompiledRoute} * Which will be used for the Role creation. * @param guild * The {@link net.dv8tion.jda.core.entities.Guild Guild} for which the Role should be created. */ public RoleAction(Route.CompiledRoute route, Guild guild) { super(guild.getJDA(), route); this.guild = guild; }
/** * Creates a new MentionPaginationAction * <br>This constructor effectively makes this target specifically only * the recent mentions for the specified {@link net.dv8tion.jda.core.entities.Guild Guild}! * <br>To get the global scope use {@link #MentionPaginationAction(net.dv8tion.jda.core.JDA)} instead. * * @param guild * The Non-Null target {@link net.dv8tion.jda.core.entities.Guild Guild} * * @throws java.lang.NullPointerException * If the provided {@code guild} is {@code null} */ public MentionPaginationAction(Guild guild) { this(guild.getJDA(), guild); }
/** * Creates a new ChannelAction instance * * @param route * The {@link net.dv8tion.jda.core.requests.Route.CompiledRoute CompileRoute} * to use for this action * @param name * The name for the new {@link net.dv8tion.jda.core.entities.Channel Channel} * @param guild * The {@link net.dv8tion.jda.core.entities.Guild Guild} the channel should be created in * @param type * What kind of channel should be created */ public ChannelAction(Route.CompiledRoute route, String name, Guild guild, ChannelType type) { super(guild.getJDA(), route); this.guild = guild; this.type = type; this.name = name; }
@Override public JDA getJDA() { return getGuild().getJDA(); }
/** * The {@link net.dv8tion.jda.core.JDA JDA} instance of this GuildController * * @return the corresponding JDA instance */ public JDA getJDA() { return getGuild().getJDA(); }
/** * Removes all mentions of the specified types and replaces them with the closest looking textual representation. * * <p>Use this over {@link #stripMentions(JDA, Message.MentionType...)} if {@link net.dv8tion.jda.core.entities.User User} mentions should * be replaced with their nicknames in a specific guild based. * <br>Uses {@link net.dv8tion.jda.core.entities.Member#getEffectiveName()} * * @param guild * the guild for {@link net.dv8tion.jda.core.entities.User User} mentions * @param types * the {@link net.dv8tion.jda.core.entities.Message.MentionType MentionTypes} that should be stripped * * @return The MessageBuilder instance. Useful for chaining. */ public MessageBuilder stripMentions(Guild guild, Message.MentionType... types) { return this.stripMentions(guild.getJDA(), guild, types); }
/** * Removes all mentions and replaces them with the closest looking textual representation. * * <p>Use this over {@link #stripMentions(JDA)} if {@link net.dv8tion.jda.core.entities.User User} mentions should * be replaced with their nicknames in a specific guild based. * <br>Uses {@link net.dv8tion.jda.core.entities.Member#getEffectiveName()} * * @param guild * the guild for {@link net.dv8tion.jda.core.entities.User User} mentions * * @return The MessageBuilder instance. Useful for chaining. */ public MessageBuilder stripMentions(Guild guild) { // Note: Users can rename to "everyone" or "here", so those // should be stripped after the USER mention is stripped. return this.stripMentions(guild.getJDA(), guild, Message.MentionType.values()); }
super(guild.getJDA(), !useDiscordOrder, Route.Guilds.MODIFY_ROLES.compile(guild.getId())); this.guild = guild;
public GuildManager(Guild guild) { super(guild.getJDA(), Route.Guilds.MODIFY_GUILD.compile(guild.getId())); this.guild = new UpstreamReference<>(guild); if (isPermissionChecksEnabled()) checkPermissions(); }
public AuditLogPaginationAction(Guild guild) { super(guild.getJDA(), Route.Guilds.GET_AUDIT_LOGS.compile(guild.getId()), 1, 100, 100); if (!guild.getSelfMember().hasPermission(Permission.VIEW_AUDIT_LOGS)) throw new InsufficientPermissionException(Permission.VIEW_AUDIT_LOGS); this.guild = guild; }
super(guild.getJDA(), Route.Guilds.MODIFY_CHANNELS.compile(guild.getId()));
return new RestAction.EmptyRestAction<>(getJDA(), listedEmote);
return new AuditableRestAction<Void>(getGuild().getJDA(), route)
return new AuditableRestAction<Integer>(getGuild().getJDA(), route)
User user = getGuild().getJDA().getUserById(userId); if (user != null) // If we have the user cached then we should use the additional information available to use during the ban process. return ban(user, delDays, reason); route = route.withQueryParams("delete-message-days", Integer.toString(delDays)); return new AuditableRestAction<Void>(getGuild().getJDA(), route)
return new AuditableRestAction<Void>(getGuild().getJDA(), route, body)
return new AuditableRestAction<Void>(getGuild().getJDA(), route, body)
return new AuditableRestAction<Void>(getGuild().getJDA(), route, body)
route = route.withQueryParams("delete-message-days", Integer.toString(delDays)); return new AuditableRestAction<Void>(getGuild().getJDA(), route)
route = route.withQueryParams("reason", MiscUtil.encodeUTF8(reason)); return new AuditableRestAction<Void>(getGuild().getJDA(), route)