Skip to content

Releases: ShindouMihou/Nexus

v1.2.0

18 Apr 13:19
edee421
Compare
Choose a tag to compare

Changelog

Nexus 1.2.0 removes the previous innovative rendering mechanism to allow it to be maintained separately from Nexus itself. You can head to Reakt.Discord if you want to install it for your bot.

v1.1.0

02 Dec 16:58
4049185
Compare
Choose a tag to compare

Changelog

Nexus 1.1.0 brings a new way of writing highly reactive, or highly interactive Discord bots with ease. Nexus.R brings a refreshing, new rendering mechanism that carries a Svelte+React feel, making it more native to web developers. It is currently in use and being monitored for more improvements by Flyght.

In addition, this version adds the following changes:

  • Coroutine Addon: Coroutines are now more supported by using the new coroutine add-on.
  • Entour Addon: Adds a set of handy and useful tools to Nexus.R.

Associated Pull Requests

v1.0.0-beta.next

28 Sep 14:02
Compare
Choose a tag to compare

Nexus 1.0 is now ready for official release with the following latest changes and breaking changes from the 1.0.0-next.

Breaking Changes

NexusCommandInterceptor

Methods to add interceptors such as middlewares and afterwares in the NexusCommandInterceptor interface has been removed completely in favor of Nexus.interceptors, this is to keep the API more consistent across the board.

Migration:

- NexusCommandInterceptor.addMiddleware("key") { ... }
+ Nexus.interceptors.middleware("key") { ... }
-  NexusCommandInterceptor.middleware { ... }
+ Nexus.interceptors.middleware { ... }

NexusCommandInterceptorRepository

We're removing this altogether because there is no point in bringing this when it simply just does the same thing as the newer style but under a define function.

Migration:

- object SomeRepository: NexusCommandInterceptorRepository {
-    val SOME_MIDDLEWARE: String = "some.middleware"
-    override fun define() {
-        middleware(SOME_MIDDLEWARE) { ... }
-    }
- }
+ object SomeRepository {
+    val SOME_MIDDLEWARE: String = Nexus.interceptors.middleware("some.middleware") { ... }
+ }

cooldown in NexusCommand

We've removed cooldown field as a native field in NexusCommand, this is, in order to keep things more consistent, as we do not offer the Ratelimiter as a Nexus-Native middleware (like OptionValidation is).

Migration:

- val cooldown = Duration.ofSeconds(5)
+ @Share val cooldown = Duration.ofSeconds(5)

NexusCommonInterceptors

We recently changed NexusCommonInterceptors from a interface to an singleton, so this may cause some import issues for some people. Don't worry, just reimport it!

NexusLoggingAdapter

We recently changed the internal methods of Nexus to pass exceptions in the parameters of Nexus.logger without any placeholders (not that we even use placeholders now as we use Kotlin), so you may see exceptions being passed as a parameter even though there are no placeholders.

NexusCommand

We've removed older methods that have long been marked for deprecation, the following functions were moved:

- fun addSupportFor(vararg serverIds: Long): NexusCommand
- fun removeSupportFor(vararg serverIds: Long): NexusCommand
- fun getServerId(): Long

Migration:

val command = ...
command.associate(serverIds)
command.disassociate(serverIds)

# Same behavior as the old `NexusCommand#getServerId`
command.serverIds.first()

Major Changes

Context Menus

First-class support for context menus (user and message) in Nexus is now supported. This will make it so that we don't have to use some sketchy methods to prevent your context menus from being overridden, and this makes it easier to use Nexus with context menus.

object TestUserContextMenu: NexusUserContextMenu() {
    val name = "test"
    override fun onEvent(event: NexusContextMenuEvent<UserContextMenuCommandEvent, UserContextMenuInteraction>) {
        event.respondNowEphemerallyWith("Hello")
    }
}

object TestMessageContextMenu: NexusMessageContextMenu() {
    val name = "test"
    override fun onEvent(event: NexusContextMenuEvent<MessageContextMenuCommandEvent, MessageContextMenuInteraction>) {
        event.respondNowEphemerallyWith("Hello")
    }
}
Nexus.contextMenus(TestUserContextMenu, TestMessageContextMenu)

Failed Dispatch Afterwares

Afterwares can now listen to failed dispatch events which will significantly help with logging and analytical afterwares. Previously, afterwares weren't able to execute after a command failed to dispatch (e.g. a middleware rejecting dispatch), but now, we can listen to these events and even know which middleware caused the problem by using NexusCommandEvent.get(NexusAfterware.BLOCKING_MIDDLEWARE_KEY).

A prime example of this mechanism is the new NexusCommonInterceptors.LOG middleware:
image

object  SomeAfterware: NexusAfterware {
   override fun onAfterCommandExecution(event: NexusCommandEvent) {}
   override fun onFailedDispatch(event: NexusCommandEvent) {} // optional
}

log common afterware

We now have our first common afterware, and it's the NexusCommonInterceptors.LOG afterware which helps you log commands easily. This uses the Nexus.logger to log.

image

Minor Changes

  1. Some behavioral changes have been done to NexusConsoleLoggingAdapter.
    • We now log to stderr instead of stdout for errors.
    • Exceptions are now handled through the logging adapter.
  2. Added more utilities to NexusMessage (Kotlin-only).
    • EmbedBuilder.toNexusMessage()
    • String.toNexusMessage()
  3. Added support for inheritance parents with superclass fields, this will make it so parent inheritance can extend upon superclasses (e.g. abstract classes) and still copy the fields from there.
  4. Added support for superclasses in commands (e.g extending abstract classes).
  5. Nexus will now automatically use NexusConsoleLoggingAdapter when there is no SLF4J logger (as the default logger caused issues wherein exceptions would be ignored as there was no adapter to handle them a.k.a NOP)
  6. A new reflection engine has replaced the previous, making things significantantly easier to add and also making things easier to maintain.
  7. Added some incomplete support for nsfw field for both context and slash commands.
    • Due to Javacord issues, we cannot update the application command's nsfw field using the SlashCommandUpdater because it's missing on the current stable version of Javacord. This does not affect Nexus.synchronizer.synchronize() and Nexus.synchronizer.batchUpdate(server) as those methods uses bulkOverwrite which overwrites the entire commands altogether, allowing updates for those.
  8. You can now include additional ApplicationCommandBuilder to Nexus.synchronizer through Nexus.synchronize.include(server, commands). This is intended when you want to add your own little other stuff e.g. custom context menus that doesn't use Nexus.
  9. Added NexusCommandEvent.get(key) that returns an Object (or Any for Kotlin) as there are cases where our little type-casting doesn't really work, so we'd prefer doing it on our own.
  10. Fixed wiki links on documentations.
  11. A warning is now sent when you try to add @Inherits to an inheritance parent (as that isn't really supported), @Inherits should only be on children.
  12. We now use Nexus.launcher to dispatch all events, so you can now use coroutines or related.

v1.0.0

28 Sep 14:30
86ebbd0
Compare
Choose a tag to compare

Changelog

To read all about the changes that this brought, simply read the v1.0.0-beta pull request. Although, to know more about the changes brought about from the last version of beta, simply read v1.0.0-next.

Nexus 1.0 has long been overdue, and the main branch has always been the v1.0.0-beta, so any other bots that were created after the branch was changed to v1.0.0-beta can safely read v1.0.0-next for changes.

Otherwise, those even older bots should read the v1.0.0-beta pull request.

Associated Pull Requests

Full Changelog: v1.0.0-alpha6...v1.0.0

v1.0.0-beta.13

15 Aug 03:50
Compare
Choose a tag to compare

What's Changed

  • Added convenience methods to NexusMessage.
  • Fixes an issue where NexusMessage's ephemeral was not being respected. It will only be disrespected when it is a deferred response (since the caller of the updater only has the right to set deferred responses to ephemeral).
fun from(text: String, ephemeral: Boolean = false, builder: NexusMessageBuilder = {}): NexusMessage
fun from(ephemeral: Boolean = false, builder: NexusMessageBuilder = {}, vararg embeds: EmbedBuilder): NexusMessage

Full Changelog: v1.0.0-beta.12...v1.0.0-beta.13

v1.0.0-beta.12

04 Aug 14:17
b9992cc
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.0.0-beta.11...v1.0.0-beta.12

v1.0.0-beta.11

24 Feb 09:48
c125075
Compare
Choose a tag to compare

Changes

  • Fixes an accident where auto-defer would always cause a defer.

Full Changelog: v1.0.0-beta.10...v1.0.0-beta.11

v1.0.0-beta.10

24 Feb 09:40
f20a59e
Compare
Choose a tag to compare

Changes

  • Auto-cancel auto-defer task if the future completed before the auto-defer task started.

Full Changelog: v1.0.0-beta.09...v1.0.0-beta.095

v1.0.0-beta.09

24 Feb 08:40
8ac5933
Compare
Choose a tag to compare

What's Changed

Breaking

  • NexusMessage has been reformed to be more simpler and generalized by using Javacord's native interfaces.
  • Removed Nexus.configuration.interceptors.autoDeferMiddlewaresAfterMilliseconds in favor of Nexus.configuration.global.autoDeferAfterMilliseconds

Full Changelog: v1.0.0-beta.08...v1.0.0-beta.09

v1.0.0-beta.08

17 Feb 03:26
bd28fdd
Compare
Choose a tag to compare