Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.

Overview

Discord4J

Support Server Invite Maven Central Javadocs GitHub Workflow Status (branch)

Discord4J is a fast, powerful, unopinionated, reactive library to enable quick and easy development of Discord bots for Java, Kotlin, and other JVM languages using the official Discord Bot API.

๐Ÿƒ Quick Example

In this example for v3.1, whenever a user sends a !ping message the bot will immediately respond with Pong!.

public final class ExampleBot {

  public static void main(final String[] args) {
    final String token = args[0];
    final DiscordClient client = DiscordClient.create(token);
    final GatewayDiscordClient gateway = client.login().block();

    gateway.on(MessageCreateEvent.class).subscribe(event -> {
      final Message message = event.getMessage();
      if ("!ping".equals(message.getContent())) {
        final MessageChannel channel = message.getChannel().block();
        channel.createMessage("Pong!").block();
      }
    });

    gateway.onDisconnect().block();
  }
}

๐Ÿ”— Quick Links

๐Ÿ’Ž Benefits

  • ๐Ÿš€ Reactive - Discord4J follows the reactive-streams protocol to ensure Discord bots run smoothly and efficiently regardless of size.

  • ๐Ÿ“œ Official - Automatic rate limiting, automatic reconnection strategies, and consistent naming conventions are among the many features Discord4J offers to ensure your Discord bots run up to Discord's specifications and to provide the least amount of surprises when interacting with our library.

  • ๐Ÿ› ๏ธ Modular - Discord4J breaks itself into modules to allow advanced users to interact with our API at lower levels to build minimal and fast runtimes or even add their own abstractions.

  • โš”๏ธ Powerful - Discord4J can be used to develop any bot, big or small. We offer many tools for developing large-scale bots from custom distribution frameworks, off-heap caching, and its interaction with Reactor allows complete integration with frameworks such as Spring and Micronaut.

  • ?? Community - We pride ourselves on our inclusive community and are willing to help whenever challenges arise; or if you just want to chat! We offer help ranging from Discord4J specific problems, to general programming and web development help, and even Reactor-specific questions. Be sure to visit us on our Discord server!

๐Ÿ“ฆ Installation

Gradle

repositories {
  mavenCentral()
}

dependencies {
  implementation 'com.discord4j:discord4j-core:3.1.5'
}

Gradle Kotlin DSL

repositories {
  mavenCentral()
}

dependencies {
  implementation("com.discord4j:discord4j-core:3.1.5")
}

Maven

<dependencies>
  <dependency>
    <groupId>com.discord4jgroupId>
    <artifactId>discord4j-coreartifactId>
    <version>3.1.5version>
  dependency>
dependencies>

SBT

libraryDependencies ++= Seq(
  "com.discord4j" % "discord4j-core" % "3.1.5"
)

๐Ÿ”€ Discord4J Versions

Discord4J 3.1.x introduces performance and API enhancements, a plethora of new features, and dependency upgrades. A Migration Guide is provided to aide users and ensure a smooth and readily available transition.

Discord4J Support Gateway/API Intents
v3.2.x In development v8 Mandatory, non-privileged default
v3.1.x Current v6 Optional, no intent default
v3.0.x Maintenance only v6 No intents support

See this wiki page for more details about compatibility.

๐ŸŽ‰ Sponsors

We would like to give a special thanks to all of our sponsors for providing us the funding to continue developing and hosting repository resources as well as driving forward initiatives for community programs. In particular, we would like to give a special shoutout to these wonderful individuals:

โ›ฐ๏ธ Large Bots

Here are some real-world examples of large bots using Discord4J:

  • Groovy - An easy to use music bot used by more than 4 million servers.
  • ZeroTwo - An anime multi-purpose bot used in more than 250K servers.
  • DisCal - Implements Google Calendar into Discord as seamlessly and comprehensively as possible; serving nearly 14K servers.
  • Shadbot - A configurable multipurpose bot with music, gambling mini-games, video game stats, and more; serving almost 12K servers.

Do you own a large bot using Discord4J? Ask an admin in our Discord or submit a pull request to add your bot to the list!

โš›๏ธ Reactive

Discord4J uses Project Reactor as the foundation for our asynchronous framework. Reactor provides a simple yet extremely powerful API that enables users to reduce resources and increase performance.

public final class ExampleBot {

  public static void main(final String[] args) {
    final String token = args[0];
    final DiscordClient client = DiscordClient.create(token);

    client.login().flatMapMany(gateway -> gateway.on(MessageCreateEvent.class))
      .map(MessageCreateEvent::getMessage)
      .filter(message -> "!ping".equals(message.getContent()))
      .flatMap(Message::getChannel)
      .flatMap(channel -> channel.createMessage("Pong!"))
      .blockLast();
  }
}

Discord4J also provides several methods to aide in better reactive chain compositions, such as GatewayDiscordClient#withGateway and EventDispatcher#on with an error handling overload.

final String token = args[0];
final DiscordClient client = DiscordClient.create(token);

client.withGateway(gateway -> {
  final Publisher pingPong = gateway.on(MessageCreateEvent.class, event ->
    Mono.just(event.getMessage())
      .filter(message -> "!ping".equals(message.getContent()))
      .flatMap(Message::getChannel)
      .flatMap(channel -> channel.createMessage("Pong!")));
            
    final Publisher onDisconnect = gateway.onDisconnect()
      .doOnTerminate(() -> System.out.println("Disconnected!"));

    return Mono.when(pingPong, onDisconnect);
  }).block();

๐Ÿงต Kotlin

By utilizing Reactor, Discord4J has native integration with Kotlin coroutines when paired with the kotlinx-coroutines-reactor library.

val token = args[0]
val client = DiscordClient.create(token)

client.withGateway {
  mono {
    it.on(MessageCreateEvent::class.java)
      .asFlow()
      .collect {
        val message = it.message
        if (message.content == "!ping") {
          val channel = message.channel.awaitSingle()
          channel.createMessage("Pong!").awaitSingle()
        }
      }
  }
}
.block()

๐Ÿ“š Examples

๐Ÿ“‘ Message Embeds

// IMAGE_URL = https://cdn.betterttv.net/emote/55028cd2135896936880fdd7/3x
// ANY_URL = https://www.youtube.com/watch?v=5zwY50-necw
final MessageChannel channel = ...
channel.createEmbed(spec -> 
  spec.setColor(Color.RED)
    .setAuthor("setAuthor", ANY_URL, IMAGE_URL)
    .setImage(IMAGE_URL)
    .setTitle("setTitle/setUrl")
    .setUrl(ANY_URL)
    .setDescription("setDescription\n" +
      "big D: is setImage\n" +
      "small D: is setThumbnail\n" +
      "<-- setColor")
    .addField("addField", "inline = true", true)
    .addField("addFIeld", "inline = true", true)
    .addField("addFile", "inline = false", false)
    .setThumbnail(IMAGE_URL)
    .setFooter("setFooter --> setTimestamp", IMAGE_URL)
    .setTimestamp(Instant.now())
).block();

๐Ÿท๏ธ Find Members by Role Name

Users typically prefer working with names instead of IDs. This example will demonstrate how to search for all members that have a role with a specific name.

final Guild guild = ...
final Set<Member> roleMembers = new HashSet<>();

for (final Member member : guild.getMembers().toIterable()) {
  for (final Role role : member.getRoles().toIterable()) {
    if ("Developers".equalsIgnoreCase(role.getName())) {
      roleMembers.add(member);
      break;
    }
  }
}

return roleMembers;

Alternatively, using Reactor:

final Guild guild = ...
return guild.getMembers()
  .filterWhen(member -> member.getRoles()
    .map(Role::getName)
    .any("Developers"::equalsIgnoreCase));

๐ŸŽต Voice and Music

Discord4J provides full support for voice connections and the ability to send audio to other users connected to the same channel. Discord4J can accept any Opus audio source with LavaPlayer being the preferred solution for downloading and encoding audio from YouTube, SoundCloud, and other providers.

To get started, you will first need to instantiate and configure an, conventionally global, AudioPlayerManager.

public static final AudioPlayerManager PLAYER_MANAGER;

static {
  PLAYER_MANAGER = new DefaultAudioPlayerManager();
  // This is an optimization strategy that Discord4J can utilize to minimize allocations
  PLAYER_MANAGER.getConfiguration().setFrameBufferFactory(NonAllocatingAudioFrameBuffer::new);
  AudioSourceManagers.registerRemoteSources(PLAYER_MANAGER);
  AudioSourceManagers.registerLocalSource(PLAYER_MANAGER);
}

Next, we need to allow Discord4J to read from an AudioPlayer to an AudioProvider.

public final class LavaPlayerAudioProvider extends AudioProvider {

  private final AudioPlayer player;
  private final MutableAudioFrame frame;

  public LavaPlayerAudioProvider(final AudioPlayer player) {
    // Allocate a ByteBuffer for Discord4J's AudioProvider to hold audio data for Discord
    super(ByteBuffer.allocate(StandardAudioDataFormats.DISCORD_OPUS.maximumChunkSize()));
    // Set LavaPlayer's AudioFrame to use the same buffer as Discord4J's
    frame = new MutableAudioFrame();
    frame.setBuffer(getBuffer());
    this.player = player;
  }

  @Override
  public boolean provide() {
    // AudioPlayer writes audio data to the AudioFrame
    final boolean didProvide = player.provide(frame);

    if (didProvide) {
      getBuffer().flip();
    }

    return didProvide;
  }
}

Typically, audio players will have queues or internal playlists for users to be able to automatically cycle through songs as they are finished or requested to be skipped over. We can manage this queue externally and pass it to other areas of our code to allow tracks to be viewed, queued, or skipped over by creating an AudioTrackScheduler.

public final class AudioTrackScheduler extends AudioEventAdapter {

  private final List<AudioTrack> queue;
  private final AudioPlayer player;

  public AudioTrackScheduler(final AudioPlayer player) {
    // The queue may be modifed by different threads so guarantee memory safety
    // This does not, however, remove several race conditions currently present
    queue = Collections.synchronizedList(new LinkedList<>());
    this.player = player;
  }

  public List<AudioTrack> getQueue() {
    return queue;
  }

  public boolean play(final AudioTrack track) {
    return play(track, false);
  }

  public boolean play(final AudioTrack track, final boolean force) {
    final boolean playing = player.startTrack(track, !force);

    if (!playing) {
      queue.add(track);
    }

    return playing;
  }

  public boolean skip() {
    return !queue.isEmpty() && play(queue.remove(0), true);
  }

  @Override
  public void onTrackEnd(final AudioPlayer player, final AudioTrack track, final AudioTrackEndReason endReason) {
    // Advance the player if the track completed naturally (FINISHED) or if the track cannot play (LOAD_FAILED)
    if (endReason.mayStartNext) {
      skip();
    }
  }
}

Currently, Discord only allows 1 voice connection per server. Working within this limitation, it is logical to think of the 3 components we have worked with thus far (AudioPlayer, LavaPlayerAudioProvider, and AudioTrackScheduler) to be correlated to a specific Guild, naturally unique by some Snowflake. Logically, it makes sense to combine these objects into one, so that they can be put into a Map for easier retrieval when connecting to a voice channel or when working with commands.

public final class GuildAudioManager {

  private static final Map<Snowflake, GuildAudioManager> MANAGERS = new ConcurrentHashMap<>();

  public static GuildAudioManager of(final Snowflake id) {
    return MANAGERS.computeIfAbsent(id, ignored -> new GuildAudioManager());
  }

  private final AudioPlayer player;
  private final AudioTrackScheduler scheduler;
  private final LavaPlayerAudioProvider provider;

  private GuildAudioManager() {
    player = PLAYER_MANAGER.createPlayer();
    scheduler = new AudioTrackScheduler(player);
    provider = new LavaPlayerAudioProvider(player);

    player.addListener(scheduler);
  }

  // getters
}

Finally, we need to connect to the voice channel. After connecting you are given a VoiceConnection object where you can utilize it later to disconnect from the voice channel by calling VoiceConnection#disconnect.

final VoiceChannel channel = ...
final GuildAudioManager manager = GuildAudioManager.of(channel.getGuildId());
final AudioProvider provider = manager.getProvider();
final VoiceConnection connection = channel.join(spec -> spec.setProvider(provider)).block();

// In the AudioLoadResultHandler, add AudioTrack instances to the AudioTrackScheduler (and send notifications to users)
PLAYER_MANAGER.loadItemOrdered(manager, "https://www.youtube.com/watch?v=dQw4w9WgXcQ", new AudioLoadResultHandler() { /* overrides */ })

โŒ Disconnecting from a Voice Channel Automatically

Typically, after everyone has left a voice channel, the bot should disconnect automatically as users typically forget to disconnect the bot manually. This problem can be solved rather elegantly using a reactive approach over an imperative one as the example below demonstrates.

final VoiceChannel channel = ...
final Mono<Void> onDisconnect = channel.join(spec -> { /* TODO Initialize */ })
  .flatMap(connection -> {
    // The bot itself has a VoiceState; 1 VoiceState signals bot is alone
    final Publisher<Boolean> voiceStateCounter = channel.getVoiceStates()
      .count()
      .map(count -> 1L == count);

    // After 10 seconds, check if the bot is alone. This is useful if
    // the bot joined alone, but no one else joined since connecting
    final Mono<Void> onDelay = Mono.delay(Duration.ofSeconds(10L))
      .filterWhen(ignored -> voiceStateCounter)
      .switchIfEmpty(Mono.never())
      .then();

    // As people join and leave `channel`, check if the bot is alone.
    // Note the first filter is not strictly necessary, but it does prevent many unnecessary cache calls
    final Mono<Void> onEvent = channel.getClient().getEventDispatcher().on(VoiceStateUpdateEvent.class)
      .filter(event -> event.getOld().flatMap(VoiceState::getChannelId).map(channel.getId()::equals).orElse(false))
      .filterWhen(ignored -> voiceStateCounter)
      .next()
      .then();

    // Disconnect the bot if either onDelay or onEvent are completed!
    return Mono.first(onDelay, onEvent).then(connection.disconnect());
  });
Comments
  • Relicense to GNU LGPL 3

    Relicense to GNU LGPL 3

    The maintainers of this project have decided to relicense D4J from GPL 2 to LGPL 3 as it is a less restrictive license yet still maintains the openness of the D4J library.

    In order to do this we must get written approval from every contributor whose contribution is still present in D4J. If you are a contributor, please comment on this issue stating I, @mention, approve relicensing Discord4J to LGPL 3.

    Here are the contributors from whom we require approval:

    • [x] @austinv11
    • [x] @GrandPanda
    • [x] @chrislo27
    • [x] @theIglooo
    • [x] @quanticc
    • [x] @nerd
    • [x] @phantamanta44
    • [x] @ArsenArsen
    • [x] @lclc98
    • [x] @Masterzach32
    • [x] @craftu
    • [x] @robot-rover
    • [x] @Kaioru
    • [x] @manuelgu
    • [x] @poncethecat
    • [x] @langerhans
    • [x] @nija123098
    • [x] @davue
    • [x] @ChrisVega
    • [x] @UnderMybrella
    • [x] @DV8FromTheWorld
    • [x] @BloodShura
    • [x] @arcadeena
    • [x] @jammehcow
    • [x] @Techtony96
    • [x] @JamesGallicchio
    help wanted 
    opened by austinv11 29
  • Delegation of Individual Properties of Specs

    Delegation of Individual Properties of Specs

    Specs are a wonderful solution to modifying multiple properties of a Discord entity in one request. This is a vast improvement over v2 where changing multiple properties of any entity required multiple requests to be sent to Discord. However, with their use comes some questionable ease of use.

    The Problem

    Let's look at MessageCreateSpec for any MessageChannel. To send a simple non-embed message, either of the following is required: messageChannel.createMessage(spec -> spec.setContent("Hello World")) or messageChannel.createMessage(new MessageCreateSpec().setContent("Hello World")) The first is a Consumer variant specifically to encapsulate the spec which makes it nicer to use in code blocks and reactive chains while the second is "raw" so external creation may be applied if necessary (such as needing to build from a database).

    However, this is admittedly not as "easy" as messageChannel.createMessage("Hello World"), which was added in 691b3b and simply delegates to one of the spec variants.

    This brings up a consistency issue. What about all the other specs? Shouldn't they deserve the same treatment?

    Alternatives

    Nothing

    We simply ignore this consistency problem, and only MessageChannel#createMessage(String) is the exception.

    Apply Retroactively on Demand

    We add these delegations when demand for their use is highly requested. Sending a simple message is frequent enough to warrant it, but who are we decide what exactly is "highly requested"? Furthermore, this only just worsens the consistency. Some properties have singular properties while others don't? Not only is it a consistency issue, but may also prove to be confusing for the end-user programmer. They'll see these singular properties and, while attempting to find one that we haven't delegated yet, may be confused on where to look to apply it.

    Delegate Everything

    We make single property delegations for every property for every spec where it is valid. This will require a lot of tedious work, but removes the consistency problem and makes our API "easier" to use for cases where single property application is only needed.

    discussion area/core 
    opened by danthonywalker 26
  • Switching to Immutable Specs

    Switching to Immutable Specs

    Depends on https://github.com/Discord4J/discord-json/pull/92 and https://github.com/Discord4J/discord-json/pull/93

    Description

    Reworks the Spec API to use immutable objects. This proposal uses the power of the Immutables library to generate the Spec objects, automatically exposing convenience methods for the user to build those objects intuitively.

    Justification

    #693 #585

    Overview

    General structure

    Let's say we want to make a DoActionSpec applying to an Entity that returns some Result. The internal structure will look like this:

    @SpecStyle
    @Value.Immutable(singleton = true)
    interface DoActionSpecGenerator extends Spec<DoActionRequest> {
        
        Possible<Snowflake> property1();
        
        Possible<Integer> property2();
    
        @Override
        default DoActionRequest asRequest() {
            return  ...;
        }
    }
    
    @SuppressWarnings("immutables:subtype")
    @SpecStyle
    @Value.Immutable(builder = false)
    abstract class DoActionMonoGenerator extends Mono<Result> implements DoActionSpecGenerator {
    
        abstract Entity entity();
    
        @Override
        public void subscribe(CoreSubscriber<? super Result> actual) {
            entity().doAction(DoActionSpec.copyOf(this)).subscribe(actual);
        }
    
        @Override
        public abstract String toString();
    }
    
    • @SpecStyle is used to configure Immutables to shape our Spec objects in a way that will be consistent and intuitive to the user. The implementation is public while the abstract type is package-private.
    • The Generator interface declares all fields as ~~nullable~~ Possible fields. ~~A null field means the value is unspecified/absent~~ If the value of a field is never set explicitly it will automatically default to Possible.absent().
    • The singleton = true will tell Immutables to generate a DoActionSpec.create() factory method without params (only for specs without mandatory parameters), on which the user can chain .withXxx(...) calls. But the regular builder DoActionSpec.builder().xxx(..).build() will still be available, the user will be able to choose either of them according to their preferences.
    • The MonoGenerator abstract class allows to expose a more straightforward API for the user to build specs for the most simple cases. In our example, Entity will have two methods for our action, one which signature would be Mono<Result> doAction(DoActionSpec spec) and another one which signature would be DoActionMono doAction(). The latter is preferred for the most simple and common cases, while the former is more adapted for templating or when the construction requires more complex logic.
    • The @SuppressWarnings("immutables:subtype") is because having an Immutable extend/implement another Immutable is not officially supported by the library, but I double checked the generated classes to look for consistency problems and I haven't found any, so I just ignored the warning. The abstract toString() is also here to remove another kind of warning.

    3 ways to use Specs

    // Option 1: BanQueryMono
    member.ban().withReason("ban").block();
    
    // Option 2: BanQuerySpec with copy methods
    member.ban(BanQuerySpec.create().withReason("ban")).block();
    
    //Option 3: BanQuerySpec with regular Builder pattern
    member.ban(BanQuerySpec.builder().reason("ban").build()).block();
    

    Specs with mandatory parameters

    // Mono variant: mandatory parameters are directly included in the method signature
    guild.createCategory("category").withPosition(0).block();
    gateway.createGuild("guild", region).withIcon(icon).block();
    
    // Copy method variant: use .of(params) instead of .create()
    guild.createCategory(CategoryCreateSpec.of("category").withPosition(0)).block();
    gateway.createGuild(GuildCreateSpec.of("guild", region).withIcon(icon)).block();
    
    // Builder variant works the same
    

    Collection fields

    For the Builder pattern, Immutables automatically generates convenience methods like addX. For copy methods, Immutables doesn't offer withAddX or similar, but does offer an overload with varargs, which is also a decent option.

    Multi-parameter fields

    Handling fields with multiple parameters, like MessageCreateSpec#addFile(name, inputStream), EmbedCreateSpec#addField(title, content, inline) or GuildCreateSpec#addChannel(name, type), was a bit challenging but I found a not-too-messy way to do it.

    I create a DoActionFields class corresponding to a certain DoActionSpec, which contains internal immutable objects grouping the multiple parameters. For files in MessageCreateSpec for example it's implemented like this:

    @InlineFieldStyle
    @Value.Enclosing
    public final class MessageCreateFields {
    
        @Value.Immutable
        public interface File extends Spec<Tuple2<String, InputStream>> {
    
            static File of(String name, InputStream inputStream) {
                return ImmutableMessageCreateFields.File.of(name, inputStream);
            }
    
            String name();
    
            InputStream inputStream();
    
            @Override
            default Tuple2<String, InputStream> asRequest() {
                return Tuples.of(name(), inputStream());
            }
        }
    } 
    

    For these immutables, the abstract type is public while the implementation is package-private. When constructing the spec, we can use .withFiles(File.of(name, inputStream)) for the copy method variant. For the Builder variant, thanks to the deepImmutablesDetection flag of Immutables, we can do .addFile(name, inputStream) directly without having to do File.of(...) manually!

    Removable fields

    The last thing is about specs allowing to remove a field. This is applicable for fields like MemberEditSpec#nickname or any field in MessageEditSpec. With old specs, calling messageEditSpec.setEmbed(null) would remove the embed, while not calling the method at all would just leave the old one unchanged. With these new Specs, this behavior can be reproduced by enabling Possible encodings from discord-json in the spec package.

    Limitations

    Fortunately the only limitations I found are relatively minor, but they are still worth mentioning:

    • The "package-private abstract type, public implementation type" approach makes us unable to write our own javadocs on the Spec objects since they are all auto generated.
    • Some generated copy methods may be redundant for the Mono variant, for example it is possible to do entity.doAction().withEntity(entity2). I opened an issue on the Immutables repository to request a feature that would allow to disable the generation of specific copy methods, but probably won't happen any time soon https://github.com/immutables/immutables/issues/1303
    feature-request area/core API change 
    opened by Alex1304 25
  • Rework the state layer of Discord4J

    Rework the state layer of Discord4J

    The description of this PR is updated according to the latest discussions about architectural changes happening in this PR and on the Discord server.

    Description

    • discord4j-core no longer depends on the old stores-api (Discord4J/Stores)
    • In discord4j-common a new package discord4j.common.store was created. It contains a Store class which has 1 public method execute(action). It is constructed via Store#fromLayout(layout), StoreLayout being an interface that may be moved to a separate module above d4j-common later, it defines the minimal set of actions required by d4j as well as the possibility to add custom action mappings. A default StoreLayout implementation is proposed via the PR #799.
    • Store actions that deal with gateway updates are fired directly in the discord4j-gateway module via the new class DispatchStoreLayer. It is independent from the gateway client itself, it allows to keep a store updated in projects that only depends on discord4j-gateway.
    • *DispatchHandlers classes in discord4j-core module have been significantly simplified, now they no longer do any store operations, their sole purpose now is only to convert dispatches to core Event entities (and async request members for guild create). A third generic type parameter had to be added on DispatchContext to know the type of the old state.
    • StateHolder has been removed, all references to it were replaced by the new Store class.

    Justification

    The current state layer provided by Discord4J via the Discord4J/Stores project is showing its limitations, as the current interface only has two generic methods to save and find entities, but no way to send specific updates when a gateway update event is received. It currently has to retrieve the whole entity first, then update it locally, then re-insert it back to the Store which is extremely costly in some scenarios. This new API defines layouts to handle individual gateway events and find operations required by d4j, while opening the path for specific store implementations to handle custom queries.

    feature-request API change PR merge with rebase 
    opened by Alex1304 22
  • Bot disconnects in voice channels when run on hosted instances

    Bot disconnects in voice channels when run on hosted instances

    I have encountered an issue with my discord bot joining / maintaining a connection with a voice channel when the bot is on a hosted instance (Such as ec2 or vultr). When I host it locally, this issue does not occur.

    To Reproduce:

    1. Create a music bot following the tutorial: https://github.com/Discord4J/Discord4J/wiki/Music-Bot-Tutorial (The Discord4J 3.1.x - Imperative Approach was used in my instance)
    2. Build and deploy the bot in an instance (I have tried ec2 and vultr and deployed it using: java -jar as a test)
    3. Issue the !join command, the bot should join the channel and then disconnect after about 10 seconds.

    Expected Behavior: Bot joins the voice channel

    Actual Behavior: Bot joins the voice channel but disconnects after 10 seconds. Stack trace and logs from when the !join command is issued (discord4j.voice set on DEBUG):

    07:51:04.051 [d4j-events-3] DEBUG d.c.event.ReplayingEventDispatcher - Subscription 18e80174 to VoiceStateUpdateEvent created
    07:51:04.052 [d4j-events-3] DEBUG d.c.event.ReplayingEventDispatcher - Subscription 3f331d76 to VoiceServerUpdateEvent created
    07:51:14.040 [parallel-2] DEBUG d.c.event.ReplayingEventDispatcher - Subscription 18e80174 to VoiceStateUpdateEvent disposed due to cancel
    07:51:14.048 [parallel-2] DEBUG d.c.event.ReplayingEventDispatcher - Subscription 3f331d76 to VoiceServerUpdateEvent disposed due to cancel
    07:51:14.060 [d4j-events-3] DEBUG d.c.event.ReplayingEventDispatcher - Subscription 747f281 to MessageCreateEvent disposed due to cancel
    07:51:14.065 [d4j-events-3] ERROR reactor.core.scheduler.Schedulers - Scheduler worker in group main failed with an uncaught exception
    reactor.core.Exceptions$ErrorCallbackNotImplemented: reactor.core.Exceptions$ReactiveException: java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in 'flatMap' (and no fallback has been configured)
    Caused by: reactor.core.Exceptions$ReactiveException: java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 10000ms in 'flatMap' (and no fallback has been configured)
            at reactor.core.Exceptions.propagate(Exceptions.java:393)
            at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:97)
            at reactor.core.publisher.Mono.block(Mono.java:1666)
            at marklil.App.lambda$main$2(App.java:72)
            at marklil.App.lambda$main$4(App.java:103)
            at reactor.core.publisher.LambdaSubscriber.onNext(LambdaSubscriber.java:160)
            at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:123)
            at reactor.core.publisher.FluxPeek$PeekSubscriber.onNext(FluxPeek.java:192)
            at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:112)
            at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:213)
            at reactor.core.publisher.FluxFilter$FilterConditionalSubscriber.onNext(FluxFilter.java:240)
            at reactor.core.publisher.FluxConcatArray$ConcatArraySubscriber.onNext(FluxConcatArray.java:176)
            at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.runAsync(FluxPublishOn.java:398)
            at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.run(FluxPublishOn.java:484)
            at reactor.scheduler.forkjoin.ForkJoinPoolScheduler$DisposableWorkerTask.run(ForkJoinPoolScheduler.java:443)
            at reactor.scheduler.forkjoin.ForkJoinPoolScheduler$Worker.processTaskQueue(ForkJoinPoolScheduler.java:407)
            at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)
            at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
            at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
            at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
            at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
            Suppressed: java.lang.Exception: #block terminated with an error
                    at reactor.core.publisher.BlockingSingleSubscriber.blockingGet(BlockingSingleSubscriber.java:99)
    

    Version: 3.1.0

    Other:

    • Version 1.3.50 of the Lavaplayer was used
    • Application was built and compiled in java 1.8
    • Bot was hosted on ubuntu 18.04
    • Firewall was disabled and all inbound and outbound traffic set to be allowed on all ports on vultr
    cannot reproduce area/voice 
    opened by privisi 19
  • Message could not be sent (Discord didn't return a response)

    Message could not be sent (Discord didn't return a response)

    Prerequisites

    • [x] If this is a question/suggestion, I have already considered talking about it on the Discord4J server
    • [x] This issue specifically has something to do with Discord4J
    • [x] I have attempted to look for similar issues already

    Description

    Sending a message (IChannel.sendMessage()) after a certain amount of time since the last time (around 15 min in my experience) throws a DiscordException with the message "Message could not be sent (Discord didn't return a response)".

    Steps to Reproduce

    1. Register a MessageReceived listener
    2. Call MessageReceivedEvent.getChannel().sendMessage()
    3. Invoke the command that sends the message, and repeat after 15 minutes

    Expected behavior: Expected message to send

    Actual behavior: Throws DiscordException if IChannel.sendMessage() is called after 15 minutes(ish) of non-activity

    Version affected: 2.9.2

    Additional Information

    Not much, but I've always had this issue with Discord4J. Using Java 8 and IntelliJ IDEA 2017.

    bug for team attention 
    opened by ghost 17
  • NoSuchFieldError: ALLOW_MISSING_VALUES

    NoSuchFieldError: ALLOW_MISSING_VALUES

    Prerequisites

    • [X] If this is a question/suggestion, I have already considered talking about it on the Discord4J server
    • [X] This issue specifically has something to do with Discord4J
    • [X] I have attempted to look for similar issues already

    Description

    Trying to start a Spigot plugin with shaded Discord4J 2.8.0 (where Gson was replaced by Jackson) or following causes following exception:

    java.lang.NoSuchFieldError: ALLOW_MISSING_VALUES
            at sx.blah.discord.api.internal.DiscordUtils.<clinit>(DiscordUtils.java:75) ~[?:?]
            at sx.blah.discord.api.events.EventDispatcher.<init>(EventDispatcher.java:73) ~[?:?]
            at sx.blah.discord.api.internal.DiscordClientImpl.<init>(DiscordClientImpl.java:135) ~[?:?]
            at sx.blah.discord.api.ClientBuilder.build(ClientBuilder.java:280) ~[?:?]
            at sx.blah.discord.api.ClientBuilder.login(ClientBuilder.java:300) ~[?:?]
    

    When using Discord4J 2.7.0 everything is fine. I've tried various things with different shade configuration but I couldn't fix.

    Version affected: 2.8.0 following

    discord 
    opened by Codeloper 17
  • Application crash while looking for module in JDBC library

    Application crash while looking for module in JDBC library

    Description

    When Discord4J tries to load JDBC class (in my case - Xerial's JDBC), Class.forName() causes triggered actions inside this class BEFORE declaration of another required classes (? not sure what's actually going on inside JDBC class), so we have exception like this: http://pastebin.com/Dnr7a3p9 In fact, this can happen with ANY another class in another libraries that has static { } blocks under certain circumstances. So, basicly, the simplest and the best solution avaible is to remove static module loading from Discord4J, Class.forName() is really bad. This occurs at sx.blah.discord.modules.ModuleLoader.loadExternalModules(ModuleLoader.java:223), as you can see from exception higher.

    Steps to Reproduce

    1. Create Discord4J module
    2. Add class that uses static {} blocks in way it uses libraries like xerial's JDBC (or add library like it)
    3. Profit, you're crashed forever!

    ...

    Expected behavior: module successfully loaded and everything works well

    Actual behavior: Class.forName() used to load class breaks everything

    Stacktrace (if applicable): http://pastebin.com/Dnr7a3p9

    Version affected: 2.6.1

    P.S. Sorry for my english if it is bad :(

    cannot reproduce 
    opened by ghost 17
  • Improve the events system

    Improve the events system

    Prerequisites

    • [x] I have read and understood the contribution guidelines
    • [x] This pull request follows the code style of the project
    • [x] I have tested this feature thoroughly
      • The pull was tested in a closed server bot which I am working on.

    Issues Fixed: None

    Changes Proposed in this Pull Request

    • Improves the events overall/dispatching performance.
    • Adds the support for cancelling events using event.cancel() method or setCancelled(boolean) method.
    • Adds the support for controlling the event execution order priority using EventPriority enum and priority attribute in `EventSubscriber)
    • Expose EventHandler to public with proper documentation.

    Example

    @EventSubscriber(priority = EventPriority.HIGH)
    public void handleCommand(MessageReceivedEvent event) {
    	String content = event.getMessage().getContent();
    	if (!content.startsWith("::")) {
    		return;
    	}
    	System.out.println("Command:" + content);
    	event.cancel(); 
            // calling event.cancel() will prevent this event from being passed to #handleChat handler
    }
    
    @EventSubscriber(priority = EventPriority.LOW)
    public void handleChat(MessageReceivedEvent event) {
    	// Command messages will never be called here, since they get cancelled in handleCommand method
    	String content = event.getMessage().getContent();
    	System.out.println("Chat:" + content);
    }
    
    opened by waliedyassen 16
  • No audio when using LavaPlayer until disconnect exception, then works fine

    No audio when using LavaPlayer until disconnect exception, then works fine

    Prerequisites

    • [x] If this is a question/suggestion, I have already considered talking about it on the Discord4J server
    • [x] This issue specifically has something to do with Discord4J
    • [x] I have attempted to look for similar issues already

    Description

    We've been making a bot using LavaPlayer and D4J and it suddenly stopped working, without us changing any code. We've tried using D4J 2.8.0 and 2.8.1 and neither creates any sound even though it did work fine before. It's not the song, as no youtube url will work. We do get an exception when we make our bot disconnect however:

    java.lang.NullPointerException
        at sx.blah.discord.api.internal.UDPVoiceSocket.shutdown(UDPVoiceSocket.java:157)
        at sx.blah.discord.api.internal.DiscordVoiceWS.disconnect(DiscordVoiceWS.java:144)
        at sx.blah.discord.handle.impl.obj.VoiceChannel.leave(VoiceChannel.java:143)
        at org.twobits.adagio.audio.TrackScheduler$1.run(TrackScheduler.java:51)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
    

    Note that after that disconnect, if we make it reconnect and start playing again in the dev-SNAPSHOT version any new music request DOES play perfectly. After a shutdown and reboot of the bot it will not work again until we make it disconnect and throw that same exception. In the latest RELEASE it doesn't play at all; after the reconnect it only makes the green "activity" circle glow without making any sound.

    bug declined 
    opened by Babbie 16
  • Edited roles hierarchy is too high.

    Edited roles hierarchy is too high.

    Prerequisites

    • [x] If this is a question/suggestion, I have already considered talking about it on the Discord4J server
    • [x] This issue specifically has something to do with Discord4J
    • [x] I have attempted to look for similar issues already

    Description

    I'm trying to create a role with my bot. I'm using the following code:

    RoleBuilder build = new RoleBuilder(serv).withName("rankname").withColor(Color.darkGray).setMentionable(false).setHoist(false)
    IRole role = build.build();
    

    The bot has every permission, and I mean all of them. It's at the top of the hierarchy, but I still get "Edited roles hierarchy is too high."

    Steps to Reproduce

    1. Create a bot
    2. In the ready event listener, add the above code
    3. Run the bot, and get an error

    ...

    Expected behavior: The rank would be created with the specified name and colour. Actual behavior: I get an error, and the rank is created but with the default name and colour. Stacktrace (if applicable): http://hastebin.com/raw/uvexapaviy Version affected: 2.6.1

    bug 
    opened by SamboyCoding 16
  • Move getRateLimitPerUser from TextChannel

    Move getRateLimitPerUser from TextChannel

    Feature Description: Make the edit/view of rate limit per user can be used in any channel with text. this currently is only allowed in the TextChannel and cannot set/get this value for VoiceChannel

    opened by Doc94 0
  • why editReply return discord4j.rest.http.client.ClientException *** 404 Not Found ?

    why editReply return discord4j.rest.http.client.ClientException *** 404 Not Found ?

    pom.xml

    <dependency>
        <groupId>com.discord4j</groupId>
        <artifactId>discord4j-core</artifactId>
        <version>3.2.3</version>
    </dependency>
    

    exception

    discord4j.rest.http.client.ClientException: POST /interactions/10558398405806*****/aW50ZX*****lZa05mWg/callback returned 404 Not Found with response {code=10062, message=Unknown interaction}
    	at discord4j.rest.http.client.ClientResponse.clientException(ClientResponse.java:171)
    	Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException: 
    Error has been observed at the following site(s):
    	*__checkpoint โ‡ข Request to POST /interactions/10558398405806*****/aW50****/callback [RequestStream]
    	*__checkpoint โ‡ข Request to POST /interactions/10558398405806*****/aW50****/callback [DefaultRouter]
    Original Stack Trace:
    		at discord4j.rest.http.client.ClientResponse.clientException(ClientResponse.java:171)
    		at discord4j.rest.http.client.ClientResponse.lambda$createException$13(ClientResponse.java:149)
    		at reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:125)
    		at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
    		at reactor.core.publisher.MonoFlatMap$FlatMapInner.onNext(MonoFlatMap.java:249)
    		at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:122)
    		at reactor.core.publisher.FluxHandle$HandleSubscriber.onNext(FluxHandle.java:126)
    		at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
    		at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
    		at reactor.core.publisher.FluxPeekFuseable$PeekConditionalSubscriber.onNext(FluxPeekFuseable.java:854)
    		at reactor.core.publisher.FluxMap$MapConditionalSubscriber.onNext(FluxMap.java:224)
    		at reactor.core.publisher.FluxDoFinally$DoFinallySubscriber.onNext(FluxDoFinally.java:113)
    		at reactor.core.publisher.FluxHandleFuseable$HandleFuseableSubscriber.onNext(FluxHandleFuseable.java:191)
    		at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107)
    		at reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1816)
    		at reactor.core.publisher.MonoCollectList$MonoCollectListSubscriber.onComplete(MonoCollectList.java:129)
    		at reactor.core.publisher.FluxPeek$PeekSubscriber.onComplete(FluxPeek.java:260)
    		at reactor.core.publisher.FluxMap$MapSubscriber.onComplete(FluxMap.java:144)
    		at reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:400)
    		at reactor.netty.channel.ChannelOperations.onInboundComplete(ChannelOperations.java:419)
    		at reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:473)
    		at reactor.netty.http.client.HttpClientOperations.onInboundNext(HttpClientOperations.java:702)
    		at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:113)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    		at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    		at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
    		at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:336)
    		at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:308)
    		at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    		at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1373)
    		at io.netty.handler.ssl.SslHandler.decodeNonJdkCompatible(SslHandler.java:1247)
    		at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1287)
    		at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:519)
    		at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:458)
    		at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:280)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    		at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
    		at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
    		at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
    		at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    		at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800)
    		at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:499)
    		at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:397)
    		at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
    		at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    		at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    		at java.lang.Thread.run(Thread.java:748)
    
    

    confusion

    only the case b threws out the ClientException, but case a and case c work good. why?

    code

    image

    opened by jqnote 0
  • Update javadocs, and add missing Intents

    Update javadocs, and add missing Intents

    Description: The Intents enum is out of date. The following changes have been made:

    • Some javadocs were modified to reference additional gateway events.
    • GUILD_EMOJIS is now GUILD_EMOJIS_AND_STICKERS, so GUILD_EMOJIS was marked as @Deprecated to preserve backwards compatibility, and GUILD_EMOJIS_AND_STICKERS was added with the same shift count.
    • The following new values were added:
      • MESSAGE_CONTENT(15)
      • GUILD_SCHEDULED_EVENTS(16)
      • AUTO_MODERATION_CONFIGURATION(20)
      • AUTO_MODERATION_EXECUTION(21)

    Justification: To match the current set of Intents described here: https://discord.com/developers/docs/topics/gateway#list-of-intents

    opened by j0rdanit0 0
  • Add ACTIVE_DEVELOPER User Flag

    Add ACTIVE_DEVELOPER User Flag

    Description: This PR add the new flag for active developer also add the url for the docs to check descriptions.

    Justification: https://github.com/discord/discord-api-docs/commit/26a4fe42d3b344c2ec67078731d6346bf0dc24e7

    opened by Doc94 0
  • Add query with_localizations for ApplicationService

    Add query with_localizations for ApplicationService

    Description: This add a method for get the global/guild commands with the query for localizations.

    Justification: Currently the only way to make this is making a copy paste of the service to add the query.

    opened by Doc94 0
Releases(3.2.3)
  • 3.2.3(Aug 20, 2022)

    Discord4J v3.2.3 is now available on Maven Central. We recommend this upgrade to all 3.2.x users as it includes multiple fixes and new features.

    Stable branch: 3.2.x Closed issues: Milestone Commits: https://github.com/Discord4J/Discord4J/compare/3.2.2...3.2.3

    โญ๏ธ New features and enhancements

    • Add attachment support to createInteractionResponse f344ef2bfc1bfe4926d134a7a2e4b2767a3bd2d2
    • Add missing methods to GuildMemberUpdate #1066
    • Add guild sticker support #1055
      • For custom store support, check the new default methods here
    • Add support for UnicodeEmoji and Icon for Role #1061
      • New methods: Role#getIconUrl and Role#getUnicodeEmoji
    • Add missing Embed.Type for article and GIFV #1075
    • Handle unimplemented channel types using UnknownChannel entity, allowing access to underlying ChannelData structure 454d9c126167e4b5d7a6c98ce6008de8fd257786
      • However, these channels will be excluded from methods like Guild#getChannels
    • Add localization fields to application command objects #1080
    • Handle gateway resumeUrl, allowing less frequent reconnects in the future

    ๐Ÿž Bug fixes

    • Move TweelNaclFast class to common module: fix issues due to duplicate class
    • Fix regex issue in RouteUtils under Android platform #1067
    • Fix incorrect return for Member#getEffectiveAvatarUrl #1065
    • Fix incorrectly caching VoiceStates for moved users under new stores #1070
    • Fix User#getBannerUrl calling an incorrect method #1069
    • Update Integration#isEnabled as Discord now treats this field as optional #1072
    • Fix WebhookService#executeWebhook response type if wait = false
    • Use then operator over cast in Webhook#execute
      • In the future this method may return Mono<Message>

    ๐Ÿ”จ Dependency upgrades

    ๐Ÿ’œ Contributors

    Thanks to all contributors and collaborators involved in this release @skykatik @NovaFox161 @Doc94 @dominoxp

    Source code(tar.gz)
    Source code(zip)
  • 3.2.2(Feb 21, 2022)

    Discord4J 3.2.2 is now available on Maven Central, adding support for modal interactions, multiple new features and some bug fixes.

    Stable branch: 3.2.x Closed issues: Milestone Commits: https://github.com/Discord4J/Discord4J/compare/3.2.1...3.2.2

    โญ๏ธ New features

    • Modal interactions #1059
      • New method: presentModal, takes one or more ActionRow containing TextInput components
      • New event type: ModalSubmitInteractionEvent
      • Example code here
      • Docs to be added soon
    • User timeouts #1051
      • New method in Member#edit: communicationDisabledUntil
    • Add support for locale fields on interaction
      • New methods: Interaction#getUserLocale and Interaction#getGuildLocale
    • Add support for attachment option type on interactions
      • New method: getAttachments in the resolved interaction object
      • New value: ApplicationCommandOption.Type#ATTACHMENT (type 11)
      • See this example for usage details
    • Add missing message flags and types #1042
    • Add equals/hashCode to rest entities #1052
    • Add missing ChangeKey fields in audit logs #1054
    • Add endpoint interactions validator using TweetNaclFast #1058

    ๐Ÿž Bug fixes

    • Fix channel deletions removing parent guild voice states from cache #1044
    • Fix allowed mentions behavior with new specs #1014
    • Fix incorrect type of USE_SLASH_COMMANDS permission value
    • Prevent NPE from using deprecated method Guild#getRegionId

    ๐Ÿ“” Documentation

    • Fix javadoc issue where using the search bar gave an invalid url

    ๐Ÿ”จ Dependency upgrades

    ๐Ÿ’œ Contributors

    Thanks to all contributors and collaborators involved in this release @Doc94 @brielmayer @NovaFox161 @AnthonySkoury

    Source code(tar.gz)
    Source code(zip)
  • 3.2.1(Nov 15, 2021)

    Discord4J 3.2.1 is now available on Maven Central, including bug fixes and new features like autocomplete interactions and support for text in voice channels, among others.

    • Current stable branch: 3.2.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.2.0...3.2.1
    • Closed issues: Milestone

    โš ๏ธ Upgrade considerations

    • Experimental API change: if you directly imported InteractionCreateEvent class to use methods like deferReply, reply, etc. You'll need to migrate the type to DeferrableInteractionEvent due to the implementation of autocomplete interactions in #1033. Check the linked issue for details.

    โญ๏ธ New features

    • Autocomplete application commands #1033 #1029
    • Get, edit and delete helper methods to Webhook #1026
    • Support text in voice channels 3c1cd1a9c554ce90bf4d28bb9d64c88af053c0f3
    • Member guild avatars #1013
    • Add resolve methods to context menu interactions #1019 #1007
      • getResolvedMessage and getResolvedUser
    • New channel_types in command options: getAllowedChannelTypes
    • Add PermissionOverwrite#getData #1024
    • Add min/max value support in app command options 8990d51c3ae2f3fd864cff31a314c5c8207347ae
    • New SessionInvalidatedEvent to be notified of that gateway lifecycle event #1036
    • New activity flags fe819179f7b47a28e7adc03407fd9ca46993300e
    • New user flag e85a2579417f47ab9ac176ac982e51a42b36b0be
    • New channel flag 8c49a847dafcf84f4b41f41926249abb2fcb9a82

    ๐Ÿž Bug fixes

    • Fix global allowed mentions not taking precedence with new specs #1015 #1014
    • Fix cast exception on Guild#createCategory 8bd22e5117c496b43c105ef3455f07f8a7cce737 #1030
    • Fix issue in AuditLogEntry#getChange #1037
    • Fix performance issue when adding list elements to cached guilds #1039
    • Fix incorrect user id in GatewayDataUpdater#onMessageCreate #1041
    • Return proper mention for the everyone role

    ๐Ÿ“” Documentation

    • Include generated Spec sources in sources jar #1022
    • Update embeds example in README #1040

    ๐Ÿ”จ Dependency upgrades

    ๐Ÿ’œ Contributors

    Thanks to all contributors and collaborators involved in this release @skykatik @Alex1304 @j0rdanit0 @napstr @Doc94 @NovaFox161 @darichey @danthonywalker

    Source code(tar.gz)
    Source code(zip)
  • 3.2.0(Sep 26, 2021)

    A new major release of Discord4J is now available for general usage, built from months of feedback, ideas and contributions from small and large bot owners alike. We'd like to thank all collaborators, contributors, GitHub sponsors and users working with us towards this release.

    Major releases allow us to reshape some architectural concepts required to either match Discord evolution as a platform, or new features we want to implement, so they come with migration steps that are detailed in our docs page for Migration Notes and API changes.

    What's new in v3.2

    Discord features

    • Discord API v8, providing richer error messages and mandatory gateway intents
    • Changes needed in preparation for threads, to be available in 3.3.0 snapshots
    • Reduced queries to Store as user data is provided by Discord in some payloads
    • Improved API over recent Discord additions, such as Slash commands initial response handling and resolved objects

    Entity cache

    Our entity cache (named Store in D4J) has been reworked and abstracted to enable more flexible implementations that can go beyond a fixed 9-Store scheme. A new default in-memory Store is provided and previous implementations are still compatible. Thanks a lot to @Alex1304 for designing and contributing this key feature for future performance improvements.

    Deeper org.immutables library usage, improving our deserialization process to reduce memory usage.

    New specs API

    Immutable Specs are now available in Discord4J, enabling more ways of working with API requests through Core module: easier templating, builders and Mono so you can organize your bot code to your liking. This is a very new feature so we expect to get feedback from you to make it better. Older Spec API (based on Consumer) is still available for gradual migration.

    Check our docs page for Specs for more details.

    Better audit log API

    A major release let us fix how to work better with audit logs in D4J, requiring some API changes.

    Reactor changes

    We can get the most of Reactor v2020.x changes:

    • Processor usage is deprecated and replaced with Sinks/EmitResult API for sending signals programmatically
    • Improvements to retry configurations with RetrySpec
    • Non-blocking DNS resolver in Reactor Netty 1.0.x

    What's next

    Threads support

    Discord4J v3.3 will soon start development to support threads and improve support on stage channels, features that require additional API changes.

    OAuth2

    We have a great contribution to support OAuth2 as a module in D4J from @cottoncammy, unfortunately we couldn't add it to v3.2.0 on time without affecting the planned scope. Our goal is to merge it to v3.3.x branch after threads are settled in the D4J API.

    Documentation

    Deeper involvement in our Documentation project is planned, providing more how-to guides and sections to quickly implement most common patterns. We'll make use of the Diataxis framework to organize our articles.

    Reactor

    We detected places where improvements can be made after a better understanding of Reactor as a runtime, like a more compact gateway implementation that can work better with back-pressure, mainly for standalone use cases. We would like to explore these in the upcoming releases.

    Distributed architectures

    As we remove roadblocks like improving the performance of D4J handling an initial storm of payloads in a distributed bot, we want to spend some time building Store/Connect project implementations that can work more efficiently at large scale.

    Changelog

    3.2.0

    • #1005 New methods to work with interactions
      • getReply, editReply, deleteReply, createFollowup, editFollowup, deleteFollowup
      • Prefer deferReply and deferEdit over acknowledge
    • #1001 Add support for context menu commands
      • Check the release notes from 3.1.8 for upgrade considerations
    • #966 Fix nullability annotations in new specs API
    • Add MultipartRequest support to message edit and interaction edit route
    • Upgrade to Reactor 2020.0.11
    • Fix ephemeral messages filtering
    • Fix missing guildId in stored VoiceStates
    • More details: Milestone

    RC3

    • #982 Add PartialMember implementation for message mentions
    • #980 Add ApplicationCommandInteraction::getResolved
    • #977 Add support for user banner and bannerAccentColor
    • #975 Add InteractionValidator for webhook-mode interactions
    • deac3ac3 Allow editing interaction messages with a MultipartRequest
    • More details: Milestone

    RC2

    • #959 Modify channel hierarchy in preparation for threads
    • #964 Deserialize interaction message on demand
    • More details: Milestone

    RC1

    • #799 New default JDK store, under the new entity cache system
    • #927 Immutable Specs, a new way of working with API requests
    • More details: Milestone

    M4

    • #924 Evict stale RequestStreams to reduce memory usage over time
    • #898 Make use of UserData when possible
    • #902 Custom baseUrl for DiscordWebClient
    • #899 Change log improvements #428 #851
    • More details: Milestone

    Early milestones

    • #874 Improve API for setting a client's status and activity
    • #873 Allow passing in member for calculating effective permissions
    • #871 Add methods to EntityRetriever and RestClient to make getting self Member easier
    • #796 Migrate to Reactor 2020
    • #788 New entity cache abstraction
    • #785 #787 Upgrade to Discord API v8
    • #742 Implement Webhook Execute #547
    • More details: M2 and M3

    ๐Ÿ’œ Contributors

    @TheNumberOne @qwbarch @Shadorc @Alex1304 @j0rdanit0 @napstr @NovaFox161 @skykatik @HunHage @darichey @YelsewB @Krakenied @Masterzach32 @Azn9 @keltrycroft @quanticc and everyone from the 3.1.x series changes that were included in this release:

    Source code(tar.gz)
    Source code(zip)
  • 3.1.8(Sep 25, 2021)

    Discord4J 3.1.8 is now available on Maven Central. We recommend this upgrade to all 3.1.x users, adds support for context menus, includes many bugfixes along with an interactions API change.

    • Current stable branch: 3.1.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.1.7...3.1.8
    • Closed issues: Milestone

    โš ๏ธ Upgrade considerations

    • Experimental API change: after implementing context menus in #1001, we have renamed some classes to align them with Discord and a new event hierarchy
    • This change is also applied to our 3.2.x branch

    | Previous | Current | | ----------- | ----------- | | SlashCommandEvent | ChatInputInteractionEvent | | ComponentInteractEvent | ComponentInteractionEvent | | ButtonInteractEvent | ButtonInteractionEvent | | SelectMenuInteractEvent | SelectMenuInteractionEvent |

    ๐Ÿ“” Documentation

    • A huge effort has been done to restructure our official docs while also adding many new articles, improving tutorials and examples, detailing new how-to guides about interactions, and migration details for the upcoming v3.2.0
    • Feel free to suggest changes through our support server or directly submit a PR to our docs repo: https://github.com/Discord4J/documentation

    โญ๏ธ New features

    • Add support for context menu commands #1001 #1004
    • Add SelectMenu#disabled
    • Add NUMBER command option type and asDouble option value/choice #971
    • Add "Get Original Interaction Response" endpoint #986
    • Allow MENTIONABLE to be parsed as a snowflake
    • Remove filter from ephemeral messages #996 #995

    ๐Ÿž Bug fixes

    • Fix ReactiveEventAdapter calling only the first hook when multiple ones are compatible #978
    • Fix SelectMenu#getPlaceholder returning customId #985
    • Fix error when retrieving the region name of a guild #999
    • Fix response type for command permissions edit routes
    • Fix Interactions API matching (backport of #981)

    ๐Ÿ”จ Dependency upgrades

    ๐Ÿ’œ Contributors

    Thanks to our contributors, collaborators and sponsors who helped in this release! @Lukellmann @Alex1304 @darichey @skykatik @Sophon96 @NovaFox161 @WeeskyBDW

    Source code(tar.gz)
    Source code(zip)
  • 3.1.7(Jul 10, 2021)

    Discord4J 3.1.7 is now available on Maven Central and it's recommended to all users in the 3.1.x branch, adding select menus and multiple embeds per message support, among other fixes.

    • Current stable branch: 3.1.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.1.6...3.1.7
    • Closed issues: Milestone

    โญ๏ธ New features

    • Interactions
      • Add support for select menus #949
      • Add setComponents to message edit spec #951
      • Add getMessage to SelectMenuInteractEvent and ButtonInteractEvent for convenience #952
    • Add support for multiple embeds in a single message #950
    • Add ReactionEmoji.Custom#asFormat #955

    ๐Ÿž Bug fixes

    • Region value can be null #953

    ๐Ÿ”จ Dependency upgrades

    ๐Ÿ’œ Contributors

    Thanks to our contributors and collaborators who helped in this release! @darichey @napstr @HunHage

    Source code(tar.gz)
    Source code(zip)
  • 3.1.6(Jul 2, 2021)

    Discord4J 3.1.6 is now available on Maven Central and it's recommended to all users in the 3.1.x branch. This one includes Buttons support, and we expect to publish another release soon as more components are implemented, like select menus.

    • Current stable branch: 3.1.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.1.5...3.1.6
    • Closed issues: Milestone

    โญ๏ธ New features

    • Interactions
      • Add message components (buttons) #935
      • Add slash commands permissions #877
      • Allow for ephemeral followup messages #905 #922
      • Add ApplicationCommandOptionType#MENTIONABLE #913
      • [โš ๏ธ API change ] Remove wait parameter from interactions createFollowupMessage method #904
    • Improve Region usage in specs #910 #931
    • Add method for constructing ReactionEmoji from codepoints using "U+" notation #901
    • Apply allowed mentions setting to message edit requests #892
    • Conserve order for Message#getAttachments #928 #929
      • This method will return List<Attachment> in 3.2.0, check #748 for more migration notes
    • Add utility class for creating timestamp markdown strings from java.time.Instant #941 #942
    • Add Guild#searchMembers / RestGuild#searchMembers #909 #888
    • Add IntegrationCreateEvent, IntegrationUpdateEvent and IntegrationDeleteEvent Discord4J/discord-json#56
    • Add Guild#isNsfw and #getNsfwLevel #906 #933
    • Add ApplicationTeam / ApplicationTeamMember and related methods to ApplicationInfo #919
    • Deprecation: UserService#getUserDMs #890
    • Add permission: USE_SLASH_COMMANDS #889
    • Add User.Flag#DISCORD_CERTIFIED_MODERATOR #921
    • Update Embed.MAX_DESCRIPTION_LENGTH #944
    • Multiple changes to internal data structures after Discord docs update #894 #895, some include:
      • Add Embed#getProxyUrl
      • Add Webhook#getType and source guild/channel properties
      • Add more GuildEditSpec fields
      • Add Attachment#getContentType
      • Add VoiceChannel#getRtcRegion and #getVideoQualityMode and VoiceChannelEditSpec
      • Add ApplicationInfo fields
      • Add MessageReferenceSpec#setFailIfNotExists
      • Deprecation: Invite#getTargetType to be used instead of Invite#getTargetUserType
      • Deprecation: AuditLogEntry#getUserId to be used instead of AuditLogEntry#getResponsibleUserId

    ๐Ÿž Bug fixes

    • Interactions
      • [โš ๏ธ API change ] Interaction#getChannel now returns Mono<MessageChannel> #893
      • Message#getAuthor will be empty for slash commands messages #911 #912
    • Blocking inside GatewayBootstrap#withGateway throws IllegalStateException #915

    ๐Ÿ”จ Dependency upgrades

    ๐Ÿ’œ Contributors

    Thanks to our contributors and collaborators who helped in this release! @Shadorc @darichey @Masterzach32 @vincevaris @sokratis12GR @Max2408

    Source code(tar.gz)
    Source code(zip)
  • 3.1.5(Apr 7, 2021)

    Discord4J 3.1.5 is now available on Maven Central. Most notably, this release fixes a regression in 3.1.4 regarding VoiceStates so if you use voice features, we strongly recommend this upgrade.

    • Current stable branch: 3.1.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.1.4...3.1.5
    • Closed issues: Milestone

    โญ๏ธ New features

    • Add acknowledgeEphemeral for interactions 5d3b04e3a0a762456052a5c1c5d038427a5b5cdb
    • Add InteractionResponse::deleteFollowupMessage cb22588aad0b169b7b1d2a65f24310175883702c
    • Add public accessors for IDs in rest* entities #880
    • Add "loading" message flag #883
    • Update message types for API v6 #884
    • Add initial support for Stage channels #885
      • Mostly intended to suppress deserialization errors
    • Add pending field to MemberUpdateEvent #886

    ๐Ÿž Bug fixes

    • VoiceChannel::getVoiceStates or retrieving a role by ID through REST returns empty #878 #879
    • Send silence on connect to properly receive audio on startup 0a3648c465e3653d540fb9e03b5ac9da46487b48
      • Fixes having to send audio first to allow receiving audio packets

    ๐Ÿ”จ Dependency upgrades

    • discord-json 1.5.10

    ๐Ÿ’œ Contributors

    Thanks to our contributors and collaborators who helped in this release! @Shadorc @NovaFox161 @darichey

    Source code(tar.gz)
    Source code(zip)
  • 3.1.4(Mar 29, 2021)

    Discord4J 3.1.4 is now available on Maven Central. We recommend this upgrade to all users, packing many new features and bug fixes.

    • Current stable branch: 3.1.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.1.3...3.1.4
    • Closed issues: Milestone

    โš ๏ธ Known issues

    • Calling VoiceChannel::getVoiceStates() or retrieving a role by ID through REST will yield an incorrect result due to a bug after migrating to our new ID backend #879
      • Fixed in 3.1.5

    โญ๏ธ New features

    • Add support for slash commands / interactions feature #823 #855 #830 #860 #864
      • Check #818 for some examples about how to use the feature
      • Slash commands are in current development and therefore marked as "Experimental" in Discord4J (API and behavior can change between minor releases!)
    • Reduce memory usage of JDK entity store by saving Snowflakes as long instead of String #872
    • Add member pending field for membership screening feature #819
    • Add with_counts query param to GET guild #826 #795
    • Allow retrieving raw data objects from entities #836 #829
    • Improvements to ChangeKey values for audit logs #862
    • Conserve order for user mentions, role mentions and reactions on message #857
    • Add support for guild templates #876 #791
    • Add ReactiveEventAdapter::from to combine multiple adapters 6b9fe05e5e1c1dd5c24ebb915bba87e7ced1ce23

    ๐Ÿž Bug fixes

    • Moving bot to another voice channel causes 4014 error and disconnect #824 858a97cd0ead1c6974a1b8105580b7924888e232
    • Gateway payloads memory leak #822 41c54d2b6056ef855ac38e9d3f7e1312ae9045dc 53201ba22f58a56777ea7cdd5ce690b09a7dedaf
    • Regression, JSON decoding error on bots calling member.getPresence() on themselves #838 2a6c2336d6cc53fb98ae8d380271ee549f5f3af0
    • VoiceSocket error when connecting to voice channel #849 e476bc2e14a9b695fb10e432347aaf9510282fed
    • Avatar URL is not updated for PresenceUpdateEvent #861 c57794dde21250cf9c001ec49c4c9c39df6e0171
    • Trace logging issues at RequestStream using Log4J2 + doOnEach 88ee4d704fe09417c88cc3e28e92e13529b9536b
    • Save missing Member fields on guild member updates db5e1f2fb7074c0e284d18deea357efcd60707de

    ๐Ÿ“” Documentation

    • Completed the migration to our new Docs page at https://docs.discord4j.com/
    • Feel free to contribute links and articles to our dedicated repo: https://github.com/Discord4J/documentation

    ๐Ÿ”จ Dependency upgrades

    • Reactor Dysprosium-SR18
    • Jackson 2.11.4
    • Stores 3.1.6
    • discord-json 1.5.9

    ๐Ÿ’œ Contributors

    Thanks to our contributors and collaborators who helped in this release! @Shadorc @UnderMybrella @p4czyk @kvnxiao @BButner @Redstoneguy129 @darichey

    Source code(tar.gz)
    Source code(zip)
  • 3.1.3(Dec 10, 2020)

    Discord4J 3.1.3 is now available on Maven Central. This is a recommended upgrade to all users polishing some edges in our previous release while still packing new features.

    • Current stable branch: 3.1.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.1.2...3.1.3
    • Closed issues: Milestone

    โญ๏ธ New features

    • Add support for role tags #812
    • Allow setting a default allowed mentions object when building a DiscordClient through setDefaultAllowedMentions e9d7a32
    • Add guild preview details to RestGuild #814
    • Improve exception message when using an invalid token, like a client secret
    • Add setAllowedMentions to MessageEditSpec #817

    ๐Ÿž Bug fixes

    • Fix incorrectly building MessageReferenceData when using the inline replies feature
    • Update bot's presence through gateway when requested through Member::getPresence #813

    ๐Ÿ”จ Dependency upgrades

    • Reactor Dysprosium-SR15, including reactor-core 3.3.12 and reactor-netty 0.9.15
    • Jackson 2.11.3

    ๐Ÿ’œ Contributors

    Thanks to @Shadorc for helping us towards this release

    Source code(tar.gz)
    Source code(zip)
  • 3.1.2(Nov 23, 2020)

    Discord4J 3.1.2 is now available on Maven Central. This is a recommended upgrade to all users.

    • Current stable branch: 3.1.x
    • Commits since last release: https://github.com/Discord4J/Discord4J/compare/3.1.1...3.1.2
    • Closed issues: Milestone

    โš ๏ธ Known issues

    • If you need to use inline replies feature from core module, use v3.1.3 or higher.

    โš ๏ธ Update considerations

    • Due to the recent Gateway Intents changes, a timeout was introduced to methods like getMembers and requestMembers in case you trigger a known issue when not specifying intents (as they are optional in 3.1.x) while also not enabling privileged intents in your Developer Portal.
    • This timeout can be configured in GatewayBootstrap::setMemberRequestTimeout and it defaults to 10 seconds. It is NOT applied if you specify intents when connecting to the Gateway.
    • Learn more about intents here and here.

    โš ๏ธ Behavior change

    • Experimental: errors thrown from GatewayBootstrap::withEventDispatcher function will now cause a bot to log out. This is a behavior change from previous version on an API marked as Experimental. To retain previous behavior make sure you handle all error sources.

    โญ๏ธ New features

    • Add support for inline replies #789 #809. See known issues above.
    • Add support for extracting stickers from Message objects #808
    • Add retrying capabilities to HTTP 520 errors #802 #804
    • Add IntentSet.nonPrivileged() 766e768
    • Add methods for obtaining an existing, registered VoiceConnection to associated entities #783
    • Add support for ReactiveEventAdapter through GatewayDiscordClient::on and EventDispatcher::on, allowing a more listener-like approach to event subscription a5d6153
    • Update Integration support #794
    • Add VoiceStateUpdateEvent functions to determine the kind of event #770
    • Allow enabling unpooled inbound allocation method. This can help debugging leak issues eae077b
    • Add overload to Guild::requestMembers by user ID set 4059ded
    • Reject voice connections if missing voice states intent 7d2dbeb
    • Add timeout to incompatible full member list requests b36af22
    • Deprecate PrivateChannelCreateEvent #786
    • Add subscriber context to GatewayDiscordClient::on(Class, Function) 14dab2c
    • Forward errors from withEventDispatcher to terminate Gateway connections 03bee01

    ๐Ÿž Bug fixes

    • Fix voice resume, now it's working as expected #778
    • Fix DefaultVoiceConnectionFactory not releasing resources on cancel/error 62e2526
    • Fix NPE when creating webhook on TextChannel without avatar image #777
    • Migrate deprecated retryWhen in GatewayBootstrap, this will make D4J compatible with Reactor 3.4+ or Spring Boot 2.4+ 8203a98
    • Add integration payloads to the ignored types, avoiding the annoying JSON error messages 56a37c4
    • Fix ValueInstantiationException when GuildCreateEvent contains unavailable guild #801

    ๐Ÿ“” Documentation

    • Clarify availability of Message::getGuildId #762
    • Update Guild documentation #792
    • Update Community Guild documentation #793

    ๐Ÿ”จ Dependency upgrades

    • Reactor Dysprosium-SR14, including reactor-core 3.3.11 and reactor-netty 0.9.14

    ๐Ÿ’œ Contributors

    Thanks to our contributors that helped us with PRs and ideas for this release: @cameronprater @Shadorc

    Source code(tar.gz)
    Source code(zip)
  • 3.0.16(Nov 23, 2020)

    Discord4J 3.0.16 is now available on Maven Central. This is a patch release in a maintenance-only branch and it's targeted to v3.0.x users who are unable to migrate to v3.1.x yet.

    • Commits: https://github.com/Discord4J/Discord4J/compare/3.0.15...3.0.16

    Maintenance mode reminder for 3.0: Please migrate to the 3.1 line by following our guide.

    โญ๏ธ New features

    • Add isAvailable to GuildEmoji (#740)
    • Add support for User public flags (#739)

    ๐Ÿž Bug fixes

    • Add secure() to the default HttpClient, allows connecting to secure voice servers

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium SR22, including reactor-netty https://github.com/reactor/reactor-netty/releases/tag/v0.8.22.RELEASE

    ๐Ÿ’œ Contributors

    Thanks to the following contributors that helped in this release: @Shadorc @Doc94

    Source code(tar.gz)
    Source code(zip)
  • 3.1.1(Sep 16, 2020)

    We're glad to announce that Discord4J 3.1.1 is now available on Maven Central. We recommend this upgrade to all users as it contains a series of bug fixes and new features. Check here for the changelog and here for all closed tickets in this release.

    Maintenance mode reminder for 3.0: Please migrate to the 3.1 line by following our guide.

    โญ๏ธ New features

    • Add support for channel following #753
    • Add joined_at field to GuildMemberUpdate #757
    • Simpler formatting of ClientException::toString #746
    • Add getOld function to EmojisUpdateEvent #763
    • Add new Color constants for black and white #761
    • Enable debugging gateway outbound capacity 8153d4e
    • Add missing Nullable annotations #754 125bff8
    • Add support for before and limit options to AuditLogQuerySpec #767
    • Add missing RestMessage::deleteReactions #774
    • Add Activity.Type.COMPETING #775
    • Migrate to new retryWhen operator internally. Should solve compatibility issues if running D4J with newer Reactor versions 2b653f7

    โš ๏ธ Update considerations

    • Experimental API change: Update Message::publish return type from Mono<Void> to Mono<Message> #773

    ๐Ÿž Bug fixes

    • Fix some problematic uses of Possible::get #749
    • Fix unable to connect to secure voice servers #755
    • Fix login can't complete if first connection attempt fails #759
    • Fix login can't complete if supplying a DefaultShardingStrategy #766
    • Fix requests incorrectly iterating across Multimap 83c127b

    ๐Ÿ“” Documentation

    • We're starting to migrate our wiki to https://wiki.discord4j.com/ that is based off docs folder. Please feel free to submit documentation PRs by creating new articles or suggesting changes to existing ones.
    • For 3.0.x docs: https://github.com/Discord4J/Discord4J/tree/3.0.x/docs and are visible at https://wiki.discord4j.com/en/3.0.x/
    • For 3.1.x docs: https://github.com/Discord4J/Discord4J/tree/3.1.x/docs and are visible at https://wiki.discord4j.com/en/3.1.x/

    ๐Ÿ”จ Dependency upgrades

    • Reactor Netty 0.9.12
    • Jackson 2.11.2

    ๐Ÿ’œ Contributors

    Thanks to our contributors that helped us with PRs and ideas for this release: @Alex1304 @TheNumberOne @Shadorc @qwbarch @Doc94

    Source code(tar.gz)
    Source code(zip)
  • 3.1.0(Jul 25, 2020)

    The next major release of Discord4J collects a year's worth of user feedback and experience since the last iteration. Discord4J v3.1.0 is a highly recommended upgrade for all users as it supports latest Discord features like Gateway Intents, Allowed Mentions, Member Loading and also applies our current knowledge of the Reactor runtime, allowing us to deliver a better platform to develop more features over time, in a modular way.

    We want to express our gratitude to all collaborators, contributors, GitHub sponsors and users that participated and supported us through the development stage of v3.1, you are awesome!

    What's new in v3.1

    As this release comes with some breaking changes, our Migration Guide is the best place to get started. Our What's new in v3.1 article also summarizes most important changes. Don't forget to check the wiki for new 3.1 related articles.

    Future work

    Discord4J is an evolving platform aiming to cover the needs of many bot configurations and therefore a lot of challenges come next: making sure we can expand on our Stores project with efficient and scalable caching, our Connect project for distributed Bot architectures and a range improvements are on the radar.

    We also want to improve documentation and code examples on our core methods so we'll soon work on a new way to publish our documentation so collaborating with us will be made simpler.

    To achieve these goals your feedback is crucial, so participating in our Discord, asking for help, sharing your projects and ideas are always welcome! Together we can turn them into new features and knowledge to help all Discord4J users.

    Changelog

    Closed milestones towards this release: M1, M2, RC1 and all changes from RC2, RC3 and RC4 here.

    Changes in 3.0.x are in most cases forward-ported to 3.1 so they are also included: 3.0.6, 3.0.7, 3.0.8, 3.0.9, 3.0.10, 3.0.11, 3.0.12, 3.0.13, 3.0.14 and 3.0.15.

    This list is not exhaustive so if you discover something missing or need help while migrating, please let us know!

    ๐Ÿš€ Architectural changes

    • New API to build clients: DiscordClient can create GatewayDiscordClient that manages a shard group
    • A shard group now shares event dispatching and entity caching
    • DiscordClient is capable of working with the REST API independently from Gateway operations
    • Consequently, REST entities were created to interact with API objects without preemptive HTTP requests
    • Created new project to model Discord domain objects: discord-json

    โš ๏ธ Update considerations

    • Remove ShardingClientBuilder, please follow our migration guide to use the new API
    • Make DiscordClientBuilder constructor no longer publicly visible
    • Move Snowflake to common module
    • Move Permission, PermissionSet and Image to rest module
    • Change return type of Message#getContent to String
    • Change return type of ClientException#getErrorResponse (#570)
    • Change return type of GatewayClient#getResponseTime (#574)
    • Remove command module
    • Refactor Presence/Activity classes (dec1935c)
    • Remove revoked Invite field (#569)
    • Move Router customization to DiscordClientBuilder (f16e3861)
    • Some loggers were refactored or moved (19e39f7a)
    • EventDispatcher is now an interface and can be highly customized
    • Disable debug mode by default due to performance costs. If you want improved stacktraces, see reactor-tools ReactorDebugAgent or call Hooks.onOperatorDebug()

    โš ๏ธ Behavior changes

    • DiscordClient::login now completes on a successful connection. Moving forward, the method makes most sense if it returns a handle for the underlying gateway connections
    • Specs won't be called until the sequence they belong is subscribed to (#646)

    โญ๏ธ New features and enhancements

    • Add Gateway intents support (#609, #713, #718, fc6dc23c)
    • New default event dispatcher that can replay startup events to late subscribers (89996739)
    • Add event dispatcher subscription lifecycle logging (b2d5e63f)
    • Add EntityRetriever abstraction for core entity fetching (#641)
    • Improve bulkDelete implementation and documentation (#745)
    • Add ReactorResources to customize Reactor threading model and other properties (with #640 enhancement)
    • New approach to rate limiting across the board (buckets, global and gateway)
    • Use reactive return types in GlobalRateLimiter (#568)
    • Permit raw RGB values in EmbedCreateSpec#setColor (#613)
    • Replace java.awt.color with custom Color class (#705, #710)
    • Add allowed mentions to control sent message pings (#673)
    • Switch to immutable objects for our data layer using discord-json project (#522)
    • Add loggers to track raw JSON payloads and HTTP messages. See Logging
    • New API to access entity caches safely
    • Add CategorizableChannel to our channel structure (ea3bdc3)
    • Improve sorting for guild channels and roles (#540)
    • New voice implementation with resume, reconnect, voice region migration capabilities (#608)
    • New VoiceConnectionRegistry to easily access active voice connections
    • Image refactor (#534)
    • Add sharding max concurrency support
    • Add support for client_status (dec1935c)
    • Defer reading HTTP response body (#581)
    • Allow disabling guild subscriptions (85a5db56)
    • Allow disabling member requests (f8467fc3)
    • Add RequestQueue abstraction to properly handle API requests at load (#639)
    • Add configuration for max missed heartbeat ACKs and change default from 0 to 1 (4fd54c74)
    • Add REST support to "Delete All Reactions for Emoji" (#661)
    • Add getSelfMember to Guild and RestGuild classes (#668)
    • Add MemberRequestFilter to control member loading (#663)
    • Introduce an advanced DispatchEventMapper API to customize how Events are created
    • Implement event for ReactionRemoveEmoji (#669)
    • Handle non retryable gateway errors on startup (3badddff)
    • Not printing reconnect-event as error (#674)
    • Update MemberChunkEvent fields (#675)
    • Add API to request members (lazy loading) and wait for its completion (9c93af76)
    • Add methods to externally establish voice connections, meaning only connect/disconnect payloads are sent (#677)
    • Request member from the gateway if missing from the cache (#682)
    • Add configurable timeout to VoiceChannelJoinSpec (#678)
    • Attempt to zero-copy inbound Gateway payloads
    • Add method for getting all members in a guild channel (#688)
    • Add Guild#getMaxVideoChannelUsers() (#706)
    • Update default scheduler names, they include d4j in their names (f5e5f38f)
    • Replace discordapp.com with discord.com (#709)
    • Deprecate guild embed fields and add guild widget (#707)
    • Expose non-recoverable status codes through a Mono (#711 closed via a8b710d0)
    • Parse self ID from token (#697)
    • REST module support for multiple query parameters under the same name
    • Add new options to guild prune actions (e4523fc7)
    • Add missing dispatch mapping for MESSAGE_REACTION_REMOVE_EMOJI payload (7dfa7683)
    • Add RestChannel#createMessage for content and embed only (#719)
    • Many internal improvements to Gateway and Voice Gateway implementations (2ae74197, e95e19a2)
    • Add VoiceState#isSelfVideoEnabled (#722)
    • Add getGuildId and getGuild to classes missing them (#723)
    • Ensure that guild_id fields are named guildId() (#726)
    • Add VoiceChannel#isMemberConnected (#728)
    • Add disconnect cause and status to DisconnectEvent (#731)
    • Make CloseStatus#getReason return empty if reason is blank (#736)

    ๐Ÿž Bug fixes

    • Fix typo with premium_subscription_count guild field (#557)
    • Stop heartbeat first when destroying the gateway client (346110ee)
    • Close #650 allow ignoring channelId on member edit (37ccadf4)
    • Fix #656 close codes which shouldn't retry (#657)
    • Close #658 add guild_id to VoiceStates during guild create (#664)
    • Rename delete-message-days to delete_message_days (#732)

    ๐Ÿ”จ Dependency upgrades

    • Discord4J now depends on Reactor Dysprosium
    • Reactor Core v3.3.8
    • Reactor Netty v0.9.10
    • Netty v4.1.51
    • Jackson v2.11.1
    • Discord4J/discord-json v1.5.3
    • Discord4J/Stores v3.1.3

    ๐Ÿ’œ Contributors and Sponsors

    Thanks again to our contributors and sponsors that made this release possible!

    @Alex1304 @ByteAlex @cbryant02 @darichey @danthonywalker @decyg @Doc94 @JasonTheKitten @kvnxiao @Lyrth @nikammerlaan @NovaFox161 @quanticc @SizableShrimp @Shadorc @Stupremee @TheNumberOne @tterrag1098 @UnderMybrella @WinteryFox @xaanit

    Source code(tar.gz)
    Source code(zip)
  • 3.0.15(Jul 15, 2020)

    Discord4J v3.0.15 is available on Maven Central. This is a recommended upgrade to all v3.0 users, keeping up with Discord API changes and improving stability of API requests made under high load.

    Check here for the changelog and here for all closed tickets in this release.

    Instructions

    โญ๏ธ What's new

    • Add message publish (crosspost) support (#665)
    • Add more supported fields to Guild (#670)
    • Add method to fetch optional inviter (#702)
    • Move our tests to JUnit 5 and GitHub Actions

    ๐Ÿž Bug fixes

    • Fix requests never completing when discarded by backpressure (#651)
    • Fix rate limiter deadlock on high parallel load (#653)
    • Fix BanQuerySpec#setDeleteMessageDays using an incorrect request parameter name (#730)
    • Fix error 400 on ban due to incorrect content-type header (#733)
    • Apply #733 at a more general level to avoid encountering this issue in the future (cc9c9d8)
    • Protect against assembly errors within the command module (1225e3a, 1e856ba, abb2bce)
    • Fix NPE related with premium count being nullable from Discord (#735)

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium SR19
    • Stores 3.0.15

    ๐Ÿ’œ Contributors

    Thanks for your contributions to this release! @Alex1304 @Doc94 @Shadorc @ByteAlex

    Source code(tar.gz)
    Source code(zip)
  • 3.0.14(Apr 13, 2020)

    Discord4J v3.0.14 is available on Maven Central. This is a recommended upgrade to all v3.0 users as it contains important fixes to voice connections and API request stability.

    Check here for the changelog and here for all closed tickets in this release.

    Instructions

    โš ๏ธ Update considerations

    • Some methods or classes are marked as @Deprecated. While some have a Javadoc explaining their new counterpart, others are planned to require a migration guide. Expect more details about this in the v3.1 pre-releases.
    • About DiscordClientBuilder constructor: Use the static DiscordClientBuilder.create as the constructor won't be public in v3.1. You can preview some of the changes here.

    โญ๏ธ What's new

    • Add a way to customize how requests are internally queued in #639, big thanks to @Alex1304 who contributed this important feature.

    ๐Ÿž Bug fixes

    • Along with the new feature, #639 fixes an issue when large amount of requests were queued, causing a potential lockup. By default requests are now buffered while ensuring responsiveness of your bot.
    • Fix entities not being properly removed from stores on voice disconnect and guild leave #642
    • Fix an issue with the included HttpClient that didn't follow redirects, breaking voice connections #637

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium SR17
    • Stores 3.0.14

    ๐Ÿ’œ Contributors

    Thanks again to @Alex1304 for your contributions to this release!

    Source code(tar.gz)
    Source code(zip)
  • 3.0.13(Mar 22, 2020)

    Discord4J v3.0.13 is now available on Maven Central, with months worth of feedback and patches you can check here and here for all closed tickets in this release. We highly recommend this upgrade to all 3.0.x users.

    Instructions

    โญ๏ธ What's new

    • Handle invite events correctly #610 #617 #620
    • Update GuildCreateRequest and GuildCreateSpec to make all fields optional #612
    • Add VoiceState::getMember
    • Avoid spamming console/log if JSON errors occur backstage

    ๐Ÿž Bug fixes

    • Fix Guild#leave creating bad requests
    • Protect against assembly time errors in Gateway processing 912178e
    • Do the same in EventDispatcher::on(Class, Function) f5e74bb
    • Command module: add an onErrorResume block in case of unhandled errors f536709

    ๐Ÿ“” Documentation

    • Code review, including some typo fixes #607

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium-SR16
    • Stores 3.0.13
    • Jackson 2.10.3

    ๐Ÿ’œ Contributors

    Thanks to @Shadorc and @Doc94 for their contributions towards this release.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.12(Dec 24, 2019)

    Discord4J v3.0.12 is now available on Maven Central. We recommend this monthly update to all users to keep your bot in sync with the latest Discord changes, performance improvements and bug fixes.

    Instructions

    โญ๏ธ What's new

    • Keeping up with recent Discord changes and additions
    • Add message_id to optional audit entry info (#591)
    • Add missing audit log change keys (#592)
    • Add member to reaction add event (#593)
    • Add new audit log events (#594)
    • Add new message flags (#597)
    • Add member and guild id to start typing event (#598)
    • Add premium_since field to Member Update Event (#602)
    • There are still more changes to include. They are going to be added as they are documented.
    • Rework build process with Gradle 6

    ๐Ÿž Bug fixes

    • Use Objects::equals to compare reaction name to begin dealing with #590
    • Fix #588 so custom GatewayObserver instances can still be supplied when building sharded clients

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium-SR14
    • Stores 3.0.12

    ๐Ÿ’œ Contributors

    Thank you very much @Shadorc for keeping the lib up to date with the recent payload/entity/API changes!

    Check here for a full list of changes and here for all closed tickets in this release.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.11(Nov 13, 2019)

    Discord4J v3.0.11 is now available on Maven Central. We recommend this monthly update to all users to keep your bot in sync with the latest Discord changes, performance improvements and bug fixes.

    Our development efforts are now shifting towards a v3.1 pre-release. Some of the methods or classes deprecated in v3.0 will change to enable more use cases, and simplify building reactive distributed/sharded bots. We're preparing a document on it you can check here for a sneak peek.

    Instructions

    โญ๏ธ What's new

    • Use Reset-After header to compute delays (52c9800)
    • This improves the accuracy of the reaction add rate limit after the millisecond precision introduction
    • Support for retrieving new Activity (status) fields (#576)
    • Capture the HTML response into ClientException in case you get a CloudFlare error (b749cbb)
    • Make Discord4J more resilient to Discord changes providing fallback "unknown" values instead of error (#572, #577)

    ๐Ÿž Bug fixes

    • Update GamePartyResponse field types to avoid overflow exceptions (9dcf2b0)
    • There are new methods to get the long object, avoiding API changes in v3.0.x - thanks to @tterrag1098 for letting me know! (793608d)

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium-SR13
    • Jackson 2.10.1
    • Stores 3.0.10

    ๐Ÿ’œ Contributors

    Thanks to the following contributors that helped with this release: @Shadorc

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.10(Oct 6, 2019)

    We're pleased to announce that Discord4J v3.0.10 is now available on Maven Central. This is a recommended upgrade for all users, including new features and enhancements, bug fixes and dependency updates.

    Instructions

    โญ๏ธ What's new

    • Update to millisecond precision for rate limits (f7ed684)
    • Add a new version of EventDispatcher.on that can take an additional Function parameter to process each event while also protecting against any error. See the commit for example usage (c77d392)
    • Errors detected using this overload will be logged and discarded, to maintain that event subscription active.
    • Add new fields to message, for Guild following feature (#551)
    • Add new fields to voice states (#567)

    ๐Ÿž Bug fixes

    • Fix inconsistency with ReactionEmoji.Custom "isAnimated" field #552 #566
    • Fix an NPE with ExtendedInvite revoked field, to be removed in v3.1 (0aa0955)
    • Fix equality checks for reaction add/remove events (c2840ef)

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium-SR12 which bumps reactor-netty to v0.8.12, check their release notes here
    • Jackson v2.10.0, check release notes here
    • Stores v3.0.9
    • If you use our redis-backed Store you might be affected by this Jackson upgrade if you transitively require v2.9.x due to new API being used. Make sure you're using v2.10.x.

    ๐Ÿ’œ Contributors

    Thanks to the following contributors that helped with this release: @Shadorc @Doc94

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.9(Sep 9, 2019)

    This is the 9th maintenance patch in the v3.0 line, now available on Maven Central.

    Instructions

    โญ๏ธ New features / Enhancements

    • Support missing guild fields (#558)
    • Support missing invite fields (#559)
    • Avoid logging huge objects when dispatcher errors (2a960a1)

    ๐Ÿž Bug fixes

    • Fix behavior of Member#asMember (#554)
    • Rename accessToken JsonProperty in GuildMemberAddRequest (#562)

    ๐Ÿ”จ Dependency upgrades

    • Reactor Californium SR11
    • reactor-core release notes: https://github.com/reactor/reactor-core/releases/tag/v3.2.12.RELEASE
    • reactor-netty release notes: https://github.com/reactor/reactor-netty/releases/tag/v0.8.11.RELEASE
    • netty 4.1.39.Final

    ๐Ÿ’œ Contributors

    Thanks to our contributors that collaborated in this release: @knightzmc @Shadorc

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.8(Aug 5, 2019)

    This is the 8th maintenance patch in the v3.0 line, now available on Maven Central.

    Instructions

    ๐Ÿž Bug fixes

    • Fix an NPE when receiving MessageReactionRemove (#548)

    ๐Ÿ“” Documentation

    • Documentation updates (#541, #542)

    ๐Ÿ”จ Dependency upgrades

    ๐Ÿ’œ Contributors

    Thanks to the contributors that participated in this release: @Doc94

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.7(Jun 15, 2019)

    This is the 7th maintenance patch in the v3.0 line, now available on Maven Central and recommended to all v3.0.x users.

    Instructions

    โญ๏ธ New features

    • Allow turning any kind of store into a shard-aware one (#538)
    • Add support to guild boost feature (#539)

    ๐Ÿž Bug fixes

    • Fix Image#ofUrl() Content-Type parsing
    • Fix heartbeat delay calculation, no more false-positive reconnects

    ๐Ÿ”จ Dependency upgrades

    • Upgrade to Reactor Core 3.2.10
    • Upgrade to Reactor Netty 0.8.9 (https://github.com/reactor/reactor-netty/releases/tag/v0.8.9.RELEASE)
    • Upgrade to Stores 3.0.6

    ๐Ÿ’œ Contributors

    Thanks to the contributors that participated in this release: @Alex1304 @Doc94

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.6(May 27, 2019)

    This is the 6th maintenance patch in the v3.0 line, now available on Maven Central. We recommend this upgrade to all 3.0.x users.

    Instructions

    โญ๏ธ New features

    • Support Banner image in guild, a verified guild feature (#526)
    • Allow using a custom global rate limiter (#531)
    • Add some image utilities and docs (#532)
    • Publish heartbeat ACK on separate scheduler, to mitigate latency effects on startup if a bot belongs to many large guilds

    ๐Ÿž Bug fixes

    • Properly react to websocket closing after reactor-netty upgrade
    • Fix broken nsfw property (#528)

    ๐Ÿ”จ Dependency upgrades

    • Discord4J Stores 3.0.5
    • Jackson Databind 2.9.9 (https://github.com/FasterXML/jackson/wiki/Jackson-Release-2.9.9)

    ๐Ÿ’œ Contributors

    Thanks to the contributors that participated in this release: @Doc94 @SizableShrimp

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.5(May 14, 2019)

    This is the 5th maintenance patch in the v3.0 line, now available on Maven Central.

    We recommend this upgrade to all 3.0.x users, it's packed with fixes and performance improvements, along with those from upgraded reactor-core and reactor-netty.

    Instructions

    โš ๏ธ Update considerations

    • Change the default event scheduler name to "discord4j-events"
    • Move discord4j.dispatch logger to discord4j.events, and using dispatch to actually log dispatch
    • Deprecate getters from client builders, to prepare for v3.1 removal

    โญ๏ธ New features

    • Add support for GUILD_NEWS and GUILD_STORE Discord type channels (#524)
    • Allow configuring the level of parallelism while making API requests (related to #525)
    • Add publish method to EventDispatcher, to manually produce events to your listeners

    ๐Ÿž Bug fixes

    • Global Rate Limiter performance improvements, properly delaying in-flight requests if the limit is hit (#525)
    • Fix audio receive task overflowing no-op receiver (#495)
    • Move interval tasks to elastic scheduler, protecting gateway impl from use cases that heavily rely on the parallel scheduler
    • Update store on member add/remove, so getMemberCount() works as expected
    • Switch gateway time calculations to nanoTime (#464)
    • Fix ReadyEvent.Guild#isAvailable

    ๐Ÿ”จ Dependency upgrades

    • Reactor Core 3.2.9 (https://github.com/reactor/reactor-core/releases/tag/v3.2.9.RELEASE)
    • Reactor Netty 0.8.8 (https://github.com/reactor/reactor-netty/releases/tag/v0.8.8.RELEASE)

    ๐Ÿ’œ Contributors

    Thanks to the contributors that participated in this release: @Alex1304 @SizableShrimp

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.4(Apr 29, 2019)

    This is the 4th maintenance patch in the v3.0 line, now available on Maven Central.

    We recommend this upgrade to every user as it includes many bugfixes including a regression in 3.0.3.

    Instructions

    ๐Ÿž Bug fixes

    • Fix a regression caused while implementing #492 that would disrupt request ordering when using flatMap
    • Fix being unable to reset a member's nickname (#519)
    • Fix potential NPE caused by a nickname reset response
    • Fix an issue with global rate limiter where requests would fail due to interrupts

    ๐Ÿ“” Documentation

    • Update docs for DiscordClientBuilder#setRouterOptions pointing to the right method if used while sharding

    Other changes

    • Include HTTP status code 500 to the list of errors that are auto-retried by default. As with other server error codes, we apply an exponential backoff with jitter strategy, that can be changed using the #492 feature
    • Add setRouterOptions to ShardingClientBuilder
    • Enable a trace logger under discord4j.rest.http to print the raw JSON entering and leaving our REST client
    • Check here for a full list of changes
    Source code(tar.gz)
    Source code(zip)
  • 3.0.3(Apr 21, 2019)

    This is the 3rd maintenance patch in the v3.0 line, now available on Maven Central.

    It contains an important bugfix so we recommend this upgrade to all users.

    Instructions

    โญ๏ธ New features

    • Custom API error handling (#492). Check this example to understand how it's used.

    ๐Ÿž Bug fixes

    • Fixes an issue with global rate limiter under high load (#513, #514). Many thanks to @Alex1304 that discovered this bug and provided an excellent report.

    ๐Ÿ”จ Dependency upgrades

    Check here for a full list of changes.

    Source code(tar.gz)
    Source code(zip)
  • 3.0.2(Apr 3, 2019)

    The Discord4J team is pleased to announce the 2nd maintenance patch in the v3.0 line, now available on Maven Central.

    We recommend this upgrade to all v3 users to get the latest changes from netty, reactor-netty and reactor-core.

    โญ๏ธ New features

    • Add missing properties to MessageUpdate dispatch (#503)
    • Use ForkJoinPoolScheduler to publish events by default, provided by the Reactor team.

    ๐Ÿž Bug fixes

    • Update reaction remove dispatch handler, closing #444. Thanks to Alex1304#9704 that helped us point to the right direction.

    ๐Ÿ“” Documentation

    • Add missing documentation to events (#512)

    ๐Ÿ”จ Dependency upgrades

    • Upgrade to Stores 3.0.2
    • Upgrade to Reactor Californium SR6
    • Upgrade to Gradle 5.3.1

    ๐Ÿ’œ Contributors

    • Thanks to the following contributors that helped in this release: @NovaFox161 @curz46
    Source code(tar.gz)
    Source code(zip)
  • 3.0.1(Mar 21, 2019)

    We're glad to announce the first maintenance patch in the v3.0 line that is now available on Maven Central.

    Thanks to your feedback we have compiled a list of improvements that will help while working on your bot.

    We're open to all suggestions so feel free to create an issue about them and if you have questions, our Discord server is a great place for them!

    Our focus for future updates is about improving documentation through javadocs and the Wiki, and also considering methods for common use cases.

    โญ๏ธ New features

    • Add MessageChannel#createEmbed shortcut to create embed-only messages
    • Member#hasHigherRoles and other related methods #504 #507 - thanks @Shadorc for the contribution!
    • Improve the API for Stores project to eliminate block instances
    • ShardingClientBuilder users will share the event scheduler instance by default to improve scaling
    • Improve handling of payload deserialization errors - generally caused by Discord changes
    • Include the shard id to event handling errors

    ๐Ÿž Bug fixes

    • Typing indicator being inconsistent #509
    • Maven users having excessive amount of logging by default. Root cause was reactor-core 3.2.5 being imported due to transitive reactor-addons depending on it
    • Member#getColor returns incorrect value

    ๐Ÿ“” Documentation

    • PermissionSet improvements #508
    • MessageChannel#typeUntil docs

    ๐Ÿ”จ Dependency upgrades

    • Pinning reactor-core to 3.2.6 because of the issue above
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Mar 5, 2019)

    After 2 years of development, Discord4J Version 3.0.0 is finally released!

    The entirety of the project has been reworked from the ground up to deliver a highly efficient, scalable, consistent, and accessible development experience. While we do not think development is finished, it never will be, we are highly confident and proud of the current product and believe it is ready for general consumption.

    Why was v2 phased out? Many reasons, but the TL;DR is it was old and fell into an irrecoverable decay. v3 has been built with a future in mind, a future in asynchronous and reactive modern Java, with an API built on consistency and modularity to allow more flexible changes into the future.

    If you are a v2 user, check out our Migration Guide. Additionally, you are always welcome to ask questions in the #d4j-v3-help channel in our Discord.

    If you are a new user, welcome! Discord4J provides a lot to offer for your bot development experience. We have adjusted our library to accommodate imperative and reactive paradigms to allow programmers of many skill levels to participate with our library. Check out the Music Bot Tutorial for an in-depth introduction to the library and programming your first bot with Discord4J.

    We want thank all our users for waiting and testing v3 during these long 2 years. On behalf of the Discord4J development team, we would especially like to thank our big bot users, mainly @Shadorc for sticking with us and helping us develop and test with his huge bot. We wouldn't be nearly as far or as battle tested without him. And an additional thank you to all our testers for providing some API feedback, submitting issues, and pull requests and are hoping for more into the future.

    3.0.0 is an exciting new era for Discord4J and we are happy for all of you to be a part of it.

    Source code(tar.gz)
    Source code(zip)
Owner
Java wrapper for the Discord API.
null
A recreation of Discord's Trick'ord Treat bot!

TrickordTreat A recreation of Discord's Trick'ord Treat bot! Don't feel like setting up the bot? Use our publicly hosted version: https://discord.com/

Scar <3 4 Nov 29, 2022
Dex : The Data Explorer -- A data visualization tool written in Java/Groovy/JavaFX capable of powerful ETL and publishing web visualizations.

Dex Dex : The data explorer is a powerful tool for data science. It is written in Groovy and Java on top of JavaFX and offers the ability to: Read in

Patrick Martin 1.3k Jan 8, 2023
hella-html is a library that makes it hella easy to generate dynamic HTML in vanilla Java.

Hella easy HTML in Java hella-html is a library that makes it hella easy to generate dynamic HTML in vanilla Java. Very lightweight and fast, the prim

null 1 Nov 23, 2022
Java Constraint Solver to solve vehicle routing, employee rostering, task assignment, conference scheduling and other planning problems.

OptaPlanner www.optaplanner.org Looking for Quickstarts? OptaPlannerโ€™s quickstarts have moved to optaplanner-quickstarts repository. Quick development

KIE (Drools, OptaPlanner and jBPM) 2.8k Jan 2, 2023
An utility to usage efficience ByteArray in Kotlin and Java.

An utility to usage efficience ByteArray in Kotlin and Java.

Cuong V. Nguyen 5 Sep 29, 2021
JMusic bot fork with new features and fixes

JMusicBot-Fork (by d1m0s23) A cross-platform Discord music bot with a clean interface, and that is easy to set up and run yourself! ?? SetupPage Fork

d1m0s23 24 Nov 18, 2022
Tencent Kona JDK11 is a no-cost, production-ready distribution of the Open Java Development Kit (OpenJDK), Long-Term Support(LTS) with quarterly updates. Tencent Kona JDK11 is certified as compatible with the Java SE standard.

Tencent Kona JDK11 Tencent Kona JDK11 is a no-cost, production-ready distribution of the Open Java Development Kit (OpenJDK), Long-Term Support(LTS) w

Tencent 268 Dec 16, 2022
Java regular expressions made easy.

JavaVerbalExpressions VerbalExpressions is a Java library that helps to construct difficult regular expressions. Getting Started Maven Dependency: <de

null 2.6k Dec 30, 2022
A Java API for checking if text contains profanity via the alt-profanity-checker Python library.

ProfanityCheckerAPI A Java API for checking if text contains profanity via the alt-profanity-checker Python library. It uses jep to run and interpret

William 2 Feb 19, 2022
High performance I/O library for Java using io_uring under the hood

nio_uring nio_uring is an I/O library for Java that uses io_uring under the hood, which aims to be: A simple and flexible API Super fast and efficient

Blake Beaupain 65 Dec 18, 2022
Diff Utils library is an OpenSource library for performing the comparison / diff operations between texts or some kind of data: computing diffs

Diff Utils library is an OpenSource library for performing the comparison / diff operations between texts or some kind of data: computing diffs, applying patches, generating unified diffs or parsing them, generating diff output for easy future displaying (like side-by-side view) and so on.

null 951 Jan 5, 2023
BlackReflection provides a series of API to use Java Reflection easily.

BlackReflection provides a series of API to use Java Reflection easily. Developer can use annotation to assign class, field and method. Then it will generate the reflection code automatically, developer don't need to write extra code to achieve Java Reflection.

null 77 Dec 8, 2022
"Pathfinder" - a small demo app made in Java, using Swing which shows an example implementation of a pathfinding algorithm based on BFS

"Pathfinder" is a small demo app made in Java, using Swing which shows an example implementation of a pathfinding algorithm based on BFS.

Dan Sirbu 2 Mar 9, 2022
๐ŸŒ๐ŸŽฎ Integrate data provided from Minecraft server with Web API.

MCWebIntegration ?? ?? Integrate data provided from Minecraft server with Web API.

yude 2 Oct 14, 2021
TheRandomAPI is an API that is responsible for generating random responses to different queries.

TheRandomAPI is an API that is responsible for generating random responses to different queries.

Elian Remaggi 1 Apr 2, 2022
A simple figura api extention that allow you to change your avatar, or upload it with script

A simple figura api extention that allow you to change your avatar, or upload it with script

null 4 Apr 14, 2022
An open-source Java library for Constraint Programming

Documentation, Support and Issues Contributing Download and installation Choco-solver is an open-source Java library for Constraint Programming. Curre

null 607 Jan 3, 2023
Java rate limiting library based on token/leaky-bucket algorithm.

Java rate-limiting library based on token-bucket algorithm. Advantages of Bucket4j Implemented on top of ideas of well known algorithm, which are by d

Vladimir Bukhtoyarov 1.7k Jan 8, 2023
A Java library for designing good error messages

JDoctor, a Java library for good error messages Designing good error messages is hard. In Java, most often, developers just rely on throwing exception

Cรฉdric Champeau 125 Oct 24, 2022