AckCord

A Discord library for Scala using Akka

MIT License

Stars
113

Bot releases are visible (Hide)

AckCord - 0.18.1 Latest Release

Published by Katrix over 2 years ago

Fixed the verifier for empty strings

AckCord - 0.18.0

Published by Katrix over 2 years ago

Additions

  • API additions since the last release.
    • Discord API v9
    • Threads
    • Application commands
    • Interactions and components
  • Add support for custom gateway events (hopefully this will rarely if ever be needed)
  • Added gateway info to events
  • Added method for bulk messages request
  • Add methods for bulk member fetching using the gateway
  • Create separate Akka-less gateway-data project (#43) (@Aly_Cerruti)

Changes

  • Rely more on the cache when constructing events
  • Rely less on the cache when constructing events if values are not in the cache
  • More info on HttpException
  • Abstracted Ratelimiter away behind a trait
  • Update the ratelimiter to fight more actively against global ratelimits and 404s

And tons of other smaller updates

AckCord - 0.17.1

Published by Katrix about 4 years ago

Small bug fix.

Bug fixes

  • Mark avatar as optional (#32) Thanks (@Yomanz)
AckCord - 0.17.0

Published by Katrix about 4 years ago

This release is all about improving core AckCord functions like the cache and gateway. It also finalizes the missing pieces from the new commands system.

Noteworthy changes and additions

  • Made it much simpler to supply a custom cache processor. One alternative is already included, that splits the cache by guild. This should be faster as events for different guilds can be processed in parallel, but might be surprising for some, so it will stay opt in for now.
  • CacheSnapshotBuilder is now immutable, and shares it's map with the snapshots created from it. This should mean much better performance and memory usage as long as you don't have a custom CacheEvent that does tons of updates.
  • Cache has been renamed to Events and now holds more than just the cache. It now also gives access to listen directly to the messages received from the gateway before AckCord does more processing on them. This might help for you if AckCord can't construct an APIMessage due to missing values in the cache.
  • Types and contents of many APIMessages has changed due to correctness and to reduce the chance of a message not being created due to missing values in the cache.
  • Set defaultMustMention to false, and add a new option to bypass symbol prefix if a mention was supplied
  • Redo PrefixParser to have a structured form, and expose it's power more to you, the user. Included here is making it much easier to use dynamic configurable prefixes
  • Add a help command system to the new command system
  • Remove old commands module, no longer needed
  • Add a nicer wrapper around Future[Option[A]] than OptionT. This should remove the need for all those cats imports

Additions

  • Added a few more combinators to the message parser
  • Add capability to inject data gotten from requests into the cache. This is a new CacheEvent that can be enabled for all requests started by a Requests object by setting the alsoProcessRequests field to RequestCacheUpdate.requestsProcessor
  • Better docs and behavior for stuff in Requests
  • Allow configuring the buffer size for the cache
  • Expose lots of lower level settings in ClientSettings
  • Add an event batching system. Skips individual updates to the cache for marginal performance benefits. Opt in
  • Give easier access to the actor system from high level code
  • Make it possible to log out, and then in again in the high level API
  • Make failure in flowSuccess configurable. If ignoreFailures is true, the old behavior is kept. The failed request is logged and ignored
    If ignoreFailures is false, the error is thrown. For methods that run a single request, the error is not ignored
  • Add a command type that also has a description

Changes

  • Check edit timestamp for cache eviction on messages
  • More async and parallelism in action builders
  • Add stacktrace when cache updater isn't found
  • Log if no event was created from an APIMessage cache update
  • Add some more stuff to the cache
  • Make removal of messages from the cache more configurable
  • Redo some of the code around reconnecting and restarting the gateway. Should now be more correct, and do less restarts
  • Increase retry limit
  • Add support for zlib-stream
  • Log when the WS stream is shut down at a debug level
  • Log sent and received stuff to their own logger
  • Log some other stuff to their own logger
  • Better logging in RateLimiter
  • Add spurious wakeup to Ratelimiter
  • Use classes for action builders

Fixes

  • Renamed GuildMessage to GuildGatewayMessage as this type of message is only received from the gateway
  • Voice channel getter now has the correct more specialized type
  • Guild unavailable is always optional. Fixes #23
  • Stop and log a warning if shard is stopped before it's started
  • Guard against handling errors twice in the gateway handler
  • Watch the right gateway handler Fixes #26
  • Fix CDN route. Closes #21
  • stop LavaplayerHandler actor when associated player is destroyed (#27) (Thanks to Jonathan Ostrander)
  • Don't log an debug error for known but ignored cache types
  • [FIX] ensure that absolute rate limit reset time is in the future (#29) (Thanks to Jonathan Ostrander)
  • Cache GuildMembers received in VoiceStates
AckCord - 0.16.0

Published by Katrix over 4 years ago

Alright, finally got 0.16.0 released. This is a big release that fixes many long standing issues in AckCord. My hope is that if nothing else shows up, 1.0.0 is finally in sight. Sorry in advance for probably breaking a lot of code with this release.

Big additions/changes:

  • Rename commands to commands-old, and switch which one the high level API uses
  • Deprecate RequestRunner, rename RequestHelper to Requests and create RequestsHelper to replace RequestRunner
  • Add something similar to the commands DSL for event to the high level api
  • Remove HasCache and flatten out the effect types a bit in the high level api
  • Fixes and bring back partial functions for high level API
  • Add support for intents
  • Implement cache invalidation
  • Make unknown value for enums
  • Remove T/V channel naming convention
  • Change to using opaque types instead of tagged types
    • Snowflake ids are now covariant
    • Channels now have specialized ids for each type

Additions

  • Add bulk run method to CommandConnector
  • Add a way to set the default value of mustMetion
  • Better logging
  • Use new IP Discovery for voice
  • Misc new API additions
  • Allow sending file messages from arbitrary sources
  • Collect register info in it's own types, and improve naming convention around the place

Fixes

  • Handle quoted command arguments
  • Fix voice error handling
  • Permission checks are now optimistic instead of pessimistic
  • Fix ratelimiter
  • Fix retry requests
AckCord - 0.15.0

Published by Katrix almost 5 years ago

Alright, another big update. Last release was almost half a year ago at this point, and a lot has happened since.

Major changes

  • No more 2.11, update to something newer
  • Effect types are gone from CacheSnapshot, and a lot of other places. It's now assumed to be Id in all places.
  • Now uses Akka 2.6, together with typed actors
  • Ratelimits and requests in general got a nice update. Failed requests are now printed as stack traces when they happen for better code, and easier debugging.
  • The cache is now partially dynamic. Don't care about all those presence update events? Ignore them. Don't want to store Presence objects? Ignore them. (Still experimental)
  • Requests now use FlowWithContext to store the context. That means no more context objects on the requests themselves.
  • Voice v4

Minor updates

  • New Discord APIs like prefferedLocale, guild features, selfStream
  • Minor misc improvements to voice sending
  • Better guild routers
  • Add case sensitivity option to commands parsing
  • Add success methods for single and many
  • Add a method to shutdown the JVM after logout

Fixes

  • Now handles a few more discord types like LFG, custom status presences, PRESENCES_REPLACE and others
  • Fix voice sending
  • Better shutdown
  • Use patch for ModifyChannel
  • Handle Websocket some errors better
  • Update vChannelId in LavaplayerHandler when moved
  • Fix webhook author obj
  • Properly encode emoji parameters
  • Always terminate actor system even if logout fails
AckCord - 0.14.0

Published by Katrix over 5 years ago

Much smaller update this time

Additions:

  • Improve methods for getting permissions and roles for a guild member. The old methods are deprecated, and will be removed in the future.
  • Lot's of new commands improvements
  • Add back PresenceWatching
  • Switch to enumeratum for enums
  • Improve error reporting when json values can't be decoded
  • Misc API additions
    Add boosting information

Fixes:

  • Fix get category on guild channel not working
  • Fixed some duplicate methods in syntax
  • Fix url encoding of query params
  • Send logout signal when stopping shard
AckCord - 0.13.0

Published by Katrix over 5 years ago

Well now, this is one massive release containing both a lot of refactorings and simplifications, and lots of new API additions.

Features:

  • Get the object something references, when the object itself only contains the ID in more places
  • Lots of minor Discord API additions
  • Add shard info in ready
  • Added a map of all the different modules of AckCord to the README
  • Added new channel types

Changes:

  • Merged ackCordWebsocket into the two modules that used it
  • ackCordREST, ackCordImages and ackCordOAuth merged into ackCordRequests
  • Removed the ackcord prefix for the projects (nothing changes for you guys unless you want to contribute)
  • Moved the root package (net.katstuff.ackcord -> ackcord)
  • Merged network module into requests and websockets modules
  • Removed util module
  • Created READMEs for various modules
  • Added Id type to the ackcord package
  • Cleaned up and improved OAuth
  • Removed deprecated stuff
  • Redid voice to be more streaming. No more bursting senders
  • Redid MessageParser and moved it to commands
  • Redid request urls. Should fix all cases where query parameters were supposed to be used, but weren't
  • Updated lots of versions
  • Minor stuff I can't remember

Remappings:

  • net.katstuff.ackcord.websocket.gateway -> ackcord.gateway
  • net.katstuff.ackcord.websocket.voice -> ackcord.voice
  • net.katstuff.ackcord.http.rest -> ackcord.requests
  • net.katstuff.ackcord.http.requests -> ackcord.requests
  • net.katstuff.ackcord.http.Routes -> ackcord.requests.Routes
  • net.katstuff.ackcord -> ackcord
  • More I've forgotten about

Fixes:

  • Pass a real message to RateLimitException
  • More minor fixes
AckCord - 0.12.0

Published by Katrix almost 6 years ago

A bit smaller release this time. This release should be source compatible with 0.11 as long as you didn't use any deprecated stuff. It is NOT binary compatible however. Anyway, let's get on to the changelog.

Changelog

  • Now cross built for Scala 2.11
  • RequestHelper now provides tools to execute requests in an ordered manner
  • The retry methods in RequestHelper have been deprecated in favor of passing implicit settings that specify which behavior should be used. The current options are retry and ordered.
  • Removed deprecated stuff
  • Fixed sometimes(very rarely) sending events with a null cache state
AckCord - 0.11.0

Published by Katrix almost 6 years ago

Oh boy. This is a big one. My hope is that the central API shouldn't change too much after this version. So, on to the changes.

First the small changes and additions

  • Global syntax methods have been moved to the AckCord singleton object
  • RestOption is now used in websockets, and is as such renamed to JsonOption
  • Added convenience methods to convert an Option to a JsonOption
  • Exported JsonOption to the ackcord package
  • Added method for getting connected members to a VGuildChannel given a guild
  • Added some basic supervision for the most important streams. Yay for error reporting.
  • Moved global ratelimits to the ratelimiter actor. This means that you can no longer get a flow that only obeys route ratelimits.
  • Message types are now case objects
  • Improved type interference
  • Use circe-derivation for most json typeclass derivation. Should reduce build times for AckCord.
  • Made permission checks a thing that can be done on all requests
  • Clarified CreateEmoji emoji param, and made a utility method for unicode emojis
  • Better names for ClientSettings build method
  • The maps in CacheSnapshot can now be empty depending on the implementation. They are not empty in Core.
  • Add a generic command error class
  • Allow specifying if none, one or all command filters should report their error
  • Add Discord API stuff from the last half year
  • Add a restart shard message to DiscordShard
  • Create high level API materializers with error logging
  • Added methods to RequestHelper to run many requests at once without using streams. These complipents the single<X> methods. Retry methods have been renamed to accommodate this.
  • More stuff I probably forgot about

Next the big stuff

  • RequestDSL is dead, long live RequestRunner
  • Make auto derivation for MessageParser opt in
  • Better commands

Lastly, the fixes

  • Fix AuditLog not using raw roles
  • Doc fixes
  • Audio fixes
  • Misc model fixes
  • Fix no response requests
  • Add better error reporting for future no response requests
  • Fix wrong field name for edit message embed (thanks Flixs)
  • Add new reactions on reaction event
  • Fix gateway resume and retry
  • Fix lavaplayer module POM. You no longer need to add JCenter to your resolvers
  • Other fixes I can't remember

The big changes more in depth

Let's go over the big changes that very likely will impact your code. This release marks the first (I think), where stuff isn't changing so much that I can't retain the original methods, so for the most part, many things talked about here still, exists, but in a deprecated form.

RequestDSL has been deprecated

RequestDSL has been deprecated, and will likely be removed next minor release. In it's place there is RequestRunner. For the most part they should work similarly. Everything that took a RequestDSL now has a RequestRunner alternative instead. RequestRunner can also use Future[List[A]] behind the scenes, but you're adviced to stick to streams.

MessageParser auto derivation is opt in

Simple change to explain. MessageParser will no longer automatically derive instances for you. If you want this behavior, import MessageParser.auto._

Better commands

Commands have gotten more improvements, although not as much of a redesign as last time. The goal this time is to hand more control of how commands are parsed over to you guys.

CmdRefiner

Individual commands are now parsed by CmdRefiner. If you want back the old behavior of name + category + filters, then use CmdInfo, which is an implementation of CmdRefiner. Categories have also been changes. Simply put, they don't exist anymore. Instead we just use normal strings.

AbstractCommandSettings

You also now have control over the general shape commands have using AbstractCommandSettings. If you want the old logic back, you can continue to use CommandSettings as a default implementation.

AckCord - 0.10

Published by Katrix over 6 years ago

Alright, lot's of changes and improvements here, many to provide more flexibility and rely less on Core. The whole project has also been modularized.

First the small stuff

  • Allow outgoing video (@llamositopia)
  • If both a null and a missing field are valid for Rest request, a data type called RestOption is used instead.
  • HttpException now contains some extra data
  • Fixed GetChannelMessages
  • ShardActor no longer exists
  • Use RequestHelper.create to create a RequestHelper
  • Add support for getting guild vanity URL
  • Add Rich presence activity objects
  • Add message activity and application
  • Allow returning materialized values in commands
  • Allow HelpCmd to be used with acks
  • Improved the high-level API

Now for the more breaking changes

  • Raw data is now in the raw.data package
  • Some other stuff has also been moved around
  • All cache access is now done through some type F[_]. For cache access for more, this type is Id.
  • CacheSnapshotLike is now called CacheSnapshot. What used to be CacheSnapshot is now. MemoryCacheSnapshot. It's now very rarely used.
  • Added a Streamable typeclass to convert some type F[A] to a Source[A, NotUsed]
  • RequestDSL can now lift any type F[_] into the DSL as long as a Streamable exists for that type.
  • Some methods in RequestDSL were renamed. Aliases were removed.
  • MemoryCacheSnapshot has been moved to Core.
  • Gateway Dispatch is now lazy
  • Remove requirePerms from rest requests
  • Commands can now be used without core as long as a Commands object is provided from some other place.
AckCord - 0.9

Published by Katrix over 6 years ago

Mostly a cleanup release

Discord API Changes

  • Emoji role whitelist can now be used by everyone
  • Can now change the filter level for a guild
  • Can now specify reason for a ban
  • Values in audit log changes should be Option

AckCord changes

  • Factor in major parameters in ratelimits
  • Implemented Audit log reason for requests
  • Exposed identifier in NoMatchException
  • Expose the total amount of characters in an embed
  • Added more defaults to methods in syntax
  • Renamed config in DiscordProtocol to prevent clashes with other classes
  • Added isAllowed for CmdFilter for users with a guild id. For use in stuff like help commands.
  • Added extra field in CmdDescription to store extra info
  • Use ImageFormat in ImageData creator
  • Update akka version
  • Fix permission checks
  • Fixed not attaching context when editing a message in syntax
AckCord - 0.8.1

Published by Katrix almost 7 years ago

  • All data classes in core (+ some minor other ones) have been moved to ackcord-data which has also been released for ScalaJS.
  • Expose the fileds in RequestHelper
AckCord - 0.8

Published by Katrix almost 7 years ago

  • ackcord is now ackcord-core
  • High level API found as ackcord
  • New lavaplayer module
  • Added RequestHelper to make request flows easier
  • Official support for shards
  • Added new presence types
  • Animated emojis
  • More docs
  • Misc fixes
AckCord - 0.7

Published by Katrix almost 7 years ago

  • Yet another redo of the command system
  • Reworked requests. RequestWrapper is gone and no longer needed. If it had functionality not ported to the new system, then that is also gone and was probably not used
  • Added support for X-Ratelimit-Limit
  • More things are now streams and should work better with back pressure
  • Added non-bot command filter
  • Misc fixes (there's a lot of them)
AckCord - 0.6

Published by Katrix almost 7 years ago

  • Added converters from raw types to normal ones
  • Commands redone
  • Added method to get connected members to a VGuildChannel
  • Added more utility streams. Some of these replace GuildFilter
  • Remaining string for MessageParser is now a concrete type
  • Allow registering messages to be sent on creation of actors for GuildRouter
  • Added a default no sender to requests in syntax
  • Added basic OAuth2 request helpers
  • Misc cleanup and bugfixes
AckCord - 0.5

Published by Katrix almost 7 years ago

  • RequestsHandler is now a flow
  • SnowflakeCache is now a sink and source pair representing subscription and publishing
  • Requests can now have "nice" data types by doing a trip to the cache. DMChannel instead of RawChannel for example.
  • Added requests to get images
  • Added more messages to interact with routers and filters
  • Misc cleanup
  • Let actors stay stopped when they stop
  • No longer checks the concrete status code from a request response
AckCord - 0.4

Published by Katrix almost 7 years ago

  • All long-lived value classes have been changed to tagged types
  • Some method name changes on Permission to fix method overloading
  • Snowflakes are now represented with SnowflakeType[A] where A is some arbitrary type.
AckCord - 0.3

Published by Katrix almost 7 years ago

  • Added method to get the channel mentions of a message
  • Added method to get the formatted content of a message
  • Added methods to easily compare roles according to their position
  • Add special handling for APIMessage.Ready for GuildRouter
  • Moved mention methods out of syntax. It's a bit too important to sit there.
  • Add Boolean MessageParser
  • Changed Permission to use a Long, as it's supposed to
  • Fix using the wrong regex in the snowflake MessageParsers
AckCord - 0.2

Published by Katrix almost 7 years ago

  • Switched to representing Snowflakes as longs. Introduced SnowflakeMap as the map to use for Snowflakes.
  • Added route and method to get WS gateway with recommended shard count
  • A few utility actors, GuildFilter, PromiseResponder and PromiseSuccessResponder
  • Added a few missing syntax methods
  • Bugfixes