Skip to content

Build 2.0.1

Compare
Choose a tag to compare
@dassjosh dassjosh released this 03 Sep 21:27
· 158 commits to master since this release
8e155dc
  • Added Builders to multiple types

    • ApplicationCommandBuilder
    • MessageComponentBuilder
    • DiscordEmbedBuilder
  • Added IntegrationParser that can parse Integration events to make them easier to process

  • Added ContextMenuCommand = 23 MessageType enum

  • Added more constructors for DiscordColor

  • DiscordLink can now support multiple link plugins

  • Guild Voice states now update from socket events

  • Removed ApplicationCommandCreated/Updated/Deleted Gateway events / hooks. Bots will never receive these events.

  • Changed DiscordLink now calls hook on all plugins not just registered ones

  • Changed Bot -> BotUser in BotClient

  • Changed LogLevel -> DiscordLogLevel to avoid naming conflicts

  • Fixed multiple issues with application commands and interaction events

  • Fixed Gateway disconnecting when sending an updated bot presence that didn't use all the fields.

  • Fixed not being able to specify null for parent id in ChannelCreate

  • Fixed MessageType enum having incorrect values

  • Fixed channel id not being nullable in VoiceState

2.0.0 Patch Notes

Overview of Changes:

  • Single Websocket Per Bot Token: If multiple plugins are using the same bot token then those plugins will be grouped together for websocket and REST calls.
    This means that reloading your plugin will no longer reset the websocket.
    I'm hoping with this update to solve the connection issues but if you're still not trusting of it there are methods available to disconnect and reconnect the web socket.

  • Discord API V9: Currently the discord extension V1 uses Discord API V6.
    This version has been deprecated and will stop working in the future.
    V9 is the latest version and will be constantly updated for any API changes.

  • Gateway Intents: Switching to API >= V8 requires us to use Gateway Intents.
    These intents are to be specified when connecting and let Discord know which socket events your bot wants to listen for. I recommend only specifying the intents that you need. I will have documentation indicating what each intent will give you. If you have multiple plugins sharing a bot token and requires new intents not previously requested then the bot will disconnect and reconnect to the web socket with the updated intents. This switch will help with performance because we aren't receiving events we don't care about anymore.

  • REST Error Callback: Sometimes REST calls fail and there is no way to know if that has happened in the current version.
    With the new version, you have the option to listen for errors on all REST calls.

  • Hook Overhaul: Hooks have been changed and renamed to better fit oxide naming conventions.
    Hooks have been split up so that hooks relating to Direct Messages / Guilds have a separate hook for each. For example OnDiscordDirectMessageCreated and OnDiscordGuildMessageCreated. Where possible Channel and Guild objects have been added to hook calls.

  • Performance: Performance is one of the biggest concerns people have had with Discord Extension V1.
    While these issues wouldn't be noticed in smaller discord servers they would appear in servers with a large number of users.
    There were multiple issues that combined together made things worse which have been solved in V2. Here are some of the changes that have been made to improve performance.

    • Combining all bots using that use the same discord token to use a single websocket connection and not per plugin.
      This will prevent the server from performing the same work multiple times.
    • All lists of discord entities have been replaced with Hash's instead.
      This fixes having to loop over every Guild Member to find the discord user you were looking for.
    • Gateway intents were added in Discord API v8. This will require each plugin to specify which Discord gateway event a plugin want's to listen to.
      Discord will only send those discord events over the websocket which improves performance for us as well.
    • There are many more changes that aren't as impactful as these as well.

New Features:

  • Added the ability for plugins to upload files to discord during message create / update
  • Added support for Discord Message Components Learn More
  • Added support for Discord Slash Commands Learn More
  • Added a universal linking API provided by DiscordLink. This allows plugins that use DiscordLink to use any discord link plugin they wish and not have to worry about compatibility.
  • Added the ability for plugins to register commands in discord similar to how it's done in oxide DiscordCommand
  • Added the ability for plugins to register to DiscordMessages in specific channels using DiscordSubscriptions
  • Replaced using strings for Discord ID's with Snowflake. Snowflake is backwards compatible with using string and only the type needs to be changed.