Samp Discord Connector Versions Save

SA:MP plugin which controls a Discord bot

v0.3.6-pre

1 year ago

Adds command interaction natives. Pre release because it may break.

open.mp support added, if you're on an open.mp server please put the plugin in the components folder from now on. an edit to config.json will be required where this should be added (if you're not using enviromental variables):

"discord": {
    "bot_token": "MYBOTTOKEN"
}

refer to the readme if you're stuck. . Environmental variable SAMP_DISCORD_BOT_TOKEN is now DEPRECATED use DCC_BOT_TOKEN

Added new configuration option to control intents: SA:MP: discord_bot_intents 131071 open.mp:

"discord": {
    "bot_token": "MYBOTTOKEN",
    "intents": 131071
}

v0.3.5

3 years ago

Changes:

  • Changed the ratelimiter so it is now more accurate, no longer is limited on a per-path basis but a per-bucket basis.
  • Added an error that prints out in case you get a rate limit notification from discord, this shouldn't happen.

New features:

  • Added DCC_CreateReaction DCC_DeleteMessageReaction functions
  • Added DCC_OnMessageReaction callback
  • Added DCC_EditMessage function
  • Added DCC_SetMessagePersistent function
  • Added DCC_CacheChannelMessage function
  • Added DCC_(Create/Delete)Emoji functions
  • Added DCC_GetEmojiName function

v0.3.4

3 years ago

This update updates the discord api to v8.

Bug fixes:

  • Fixed a crash that some may encounter introduced in 0.3.3 (#160)
  • Fixed a rare crash in the rate limiter for linux (#155)

v0.3.3

3 years ago

New features:

  • Added the ability to send embedded messages. The following are some new functions to come with this support:
  • DCC_(Create/Delete)Embed
  • DCC_SendChannelEmbedMessage
  • DCC_SetEmbed(Title/Description/Url/Timestamp/Footer/...)

Bug fixes:

  • Fixed an issue where when a user changes their global username, DCC_GetUserName would return the old name. (#126)
  • Fixed an issue where an error would be reported if a channel had no category.

v0.3.2

4 years ago
  • fixed static linkage on the Linux build
  • updated log-core to v0.5.2

v0.3.1

4 years ago
  • bug-fix: some role setters didn't work correctly
  • the plugin is now linked statically, eliminating any need for specific C++ runtimes or SSL libraries (except for log-core)
  • log-core updated to v0.5.1
  • new functions for getting a channel's parent category (DCC_GetChannelParentCategory) and setting/getting a user's voice channel (DCC_[Set/Get]GuildMemberVoiceChannel)
  • new callback for server member voice updates (DCC_OnGuildMemberVoiceUpdate)

Thanks to @kubkodev for providing the new functions and callbacks! (#106)

v0.3

4 years ago

Breaking changes:

  • natives that return a Discord snowflake ID now need to have a destination array with a fixed size, DCC_ID_SIZE is the size constant:
new id[DCC_ID_SIZE];
DCC_GetChannelId(channel, id); // will throw a compile error if `id` is not exactly `DCC_ID_SIZE` large
  • function DCC_GetUserEmail has been removed with no replacement; fetching a user's email is not supported by the Discord bot API
  • callback DCC_OnChannelMessage has been removed; use DCC_OnMessageCreate as a replacement

Bug fixes:

  • offline members were not loaded into the plugin cache (see #67)
  • fixed a problem where the https service couldn't be resolved on some systems
  • several other fixes and stability improvements

New features:

  • log-core has been updated to v0.5, refer to the log-core release page for all features and changes
  • you can now specify the Discord bot token through the environment variable SAMP_DISCORD_BOT_TOKEN (optional)
  • added a way to specify result callbacks for DCC_SendChannelMessage and other "create"-type functions
  • added two new callbacks: DCC_OnMessageCreate and DCC_OnMessageDelete
  • added new message-related functions
  • added channel, role and guild setters (changing channel names, creating bans, deleting roles, ...)
  • added bot functions (changing the bot nickname, creating a private channel, setting the "playing" status, ...)
  • added a utility function to escape markdown strings (DCC_EscapeMarkdown)
  • all-in-all there's 49 new natives in this update

v0.2.4

5 years ago
  • added DCC_FindRoleByName function
  • passing an invalid UTF-8 string logs an error message
  • improved JSON validation
  • added more log messages
  • improvements to the reconnection and heart beat logic
  • the plugin now retries connecting to the Discord API servers in the background instead of failing to load the plugin on server startup
  • fixed some warnings and errors that occured during HTTP and WebSocket disconnection
  • fixed a bug where the guild member presence status was parsed incorrectly (this disabled the DCC_GetGuildMemberStatus native and spammed the log file with messages like can't update guild member presence: guild id "online" not cached)
  • fixed a performance issue where the plugin would freeze the PAWN thread in some cases
  • fixed a timing issue that was caused by the plugin using the current system time instead of the HTTP date header time
  • fixed an issue where messages, that where queued due to being rate-limited, would be sent in the wrong order
  • fixed an issue where the plugin would not find categories and voice channels

v0.2.3

6 years ago
  • added more JSON validation checks
  • added more log messages
  • fixed various problems with JSON parsing
  • fixed crash on Windows at plugin shutdown

v0.2.2

6 years ago
  • disabled debug logging due to performance constraints for some users
  • added JSON validation (this should fix various crashes users experienced)

NOTE The CentOS build might contain bugs and crashes not present in other builds. This is due to a compiler bug GCC 4.8 ships with. Support for CentOS will be removed starting with the next major or minor update.