ackcord
package ackcord
- Source
- ackcord.scala
- Alphabetic
- By Inheritance
- ackcord
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
Type Members
- sealed trait APIMessage extends AnyRef
Base trait normal messages.
- case class APIMessageCacheUpdate[Data](data: Data, sendEvent: (CacheState) => List[APIMessage], handler: CacheHandler[Data], registry: CacheTypeRegistry, dispatch: Dispatch[_]) extends CacheEvent with Product with Serializable
An event that should publish an APIMessage.
An event that should publish an APIMessage.
- Data
The data it contains.
- data
The data.
- sendEvent
A function to gather the needed variables to send the event.
- handler
The handler to process the data of this event with.
- registry
The handler registry that the event will use to update the snapshot.
- dispatch
The low level message that created this update.
- case class BatchedAPIMessageCacheUpdate(updates: Seq[APIMessageCacheUpdate[_]]) extends CacheEvent with Product with Serializable
- type BotAuthentication = ackcord.requests.BotAuthentication.type
- type Cache = Events
- trait CacheEvent extends AnyRef
Represents some sort of event handled by the cache
- case class CacheSettings(processor: CacheProcessor = MemoryCacheSnapshot.defaultCacheProcessor, parallelism: Int = 4, cacheBufferSize: PubSubBufferSize = PubSubBufferSize(), sendGatewayEventsBufferSize: PubSubBufferSize = PubSubBufferSize(), receiveGatewayEventsBufferSize: PubSubBufferSize = PubSubBufferSize(), ignoredEvents: Seq[Class[_ <: GatewayEvent[_]]] = Nil, cacheTypeRegistry: CacheTypeRegistry = CacheTypeRegistry.default, partitionCacheByGuild: Boolean = false) extends Product with Serializable
- processor
A function that runs on the cache right before a cache snapshot is produced.
- parallelism
How many cache updates are constructed in parallel
- cacheBufferSize
Size of the buffer for the cache
- sendGatewayEventsBufferSize
Size of the buffer for sending gateway events
- receiveGatewayEventsBufferSize
Size of the buffer for receiving gateway events
- ignoredEvents
Events the cache will ignore. APIMessage s aren't sent for these either.
- cacheTypeRegistry
Gives you control over how entities in the cache are updated, and what values are retained in the cache.
- partitionCacheByGuild
Instead of sharing a single cache for the entire application, this partitions the cache by guild. Each guild will in effect receive it's own cache. Cache events not specific to one guild will be sent to all caches. Unlike then default cache, this one is faster, as cache updates can be done in parallel, but might use more memory, and you need to handle cross guild cache actions yourself.
- trait CacheSnapshot extends AnyRef
A representation of the cache.
- trait CacheSnapshotWithMaps extends CacheSnapshot
A cache snapshot where the getters can use the maps to get their data.
- case class CacheState(current: MemoryCacheSnapshot, previous: MemoryCacheSnapshot) extends Product with Serializable
Represents the state of the cache for a single point.
Represents the state of the cache for a single point.
- current
The current values in the cache.
- previous
The previous values in the cache.
- trait ChannelEventListenerMessage[A] extends EventListenerMessage[A]
- case class ClientSettings(token: String, largeThreshold: Int = 50, shardNum: Int = 0, shardTotal: Int = 1, idleSince: Option[Instant] = None, activities: Seq[RawActivity] = Nil, status: PresenceStatus = PresenceStatus.Online, afk: Boolean = false, compress: Compress = Compress.ZLibStreamCompress, eventDecoders: EventDecoders = GatewayProtocol.ackcordEventDecoders, intents: GatewayIntents = GatewayIntents.AllNonPrivileged, system: ActorSystem[Nothing] = ActorSystem(Behaviors.ignore, "AckCord"), requestSettings: RequestSettings = RequestSettings(), cacheSettings: CacheSettings = CacheSettings()) extends Product with Serializable
Settings used when connecting to Discord.
Settings used when connecting to Discord.
- token
The token for the bot.
- largeThreshold
The large threshold.
- shardNum
The shard index of this shard.
- shardTotal
The amount of shards.
- idleSince
If the bot has been idle, set the time since.
- activities
Send one or more activities when connecting.
- status
The status to use when connecting.
- afk
If the bot should be afk when connecting.
- compress
What sort of compression the gateway should use.
- intents
Fine grained control over which events Discord should sent to your bot.
- system
The actor system to use.
- requestSettings
The request settings to use.
- cacheSettings
Settings the cache will use.
- trait DiscordClient extends AnyRef
Trait used to interface with Discord stuff from high level.
- class DiscordClientActor extends AbstractBehavior[Command]
- class DiscordClientCore extends DiscordClient
- trait EventListener[A, Mat] extends AnyRef
- case class EventListenerBuilder[+M[_], A <: APIMessage](requests: Requests, refineEvent: (APIMessage) => Option[A], actionFunction: ActionFunction[EventListenerMessage, M, Nothing]) extends ActionBuilder[EventListenerMessage, M, Nothing, A] with Product with Serializable
- trait EventListenerMessage[A] extends AnyRef
- case class EventRegistration[Mat](materialized: Mat, onDone: Future[Done], killSwitch: UniqueKillSwitch) extends Product with Serializable
- case class Events(publish: Sink[CacheEvent, NotUsed], subscribe: Source[(CacheEvent, CacheState), NotUsed], toGatewayPublish: Sink[GatewayMessage[Any], NotUsed], toGatewaySubscribe: Source[GatewayMessage[Any], NotUsed], fromGatewayPublish: Sink[GatewayMessage[Any], NotUsed], fromGatewaySubscribe: Source[GatewayMessage[Any], NotUsed], parallelism: Int)(implicit system: ActorSystem[Nothing]) extends Product with Serializable
Houses streams to interact with events and messages sent to and from Discord.
Houses streams to interact with events and messages sent to and from Discord.
- publish
A sink used for publishing. Any elements connected to this sink is published to the cache.
- subscribe
A source to subscribe to. All updates are pushed here.
- parallelism
How many cache updates to construct at the same time.
- abstract class EventsController extends AnyRef
- type GatewayLogin = Login.type
- type GatewayLogout = Logout.type
- type GatewaySettings = ackcord.gateway.GatewaySettings
- trait GuildEventListenerMessage[A] extends EventListenerMessage[A]
- trait GuildUserEventListenerMessage[A] extends GuildEventListenerMessage[A] with UserEventListenerMessage[A]
- type JsonNull = ackcord.util.JsonNull.type
- type JsonOption[A] = ackcord.util.JsonOption[A]
- type JsonSome[A] = ackcord.util.JsonSome[A]
- type JsonUndefined = ackcord.util.JsonUndefined.type
- case class MemoryCacheSnapshot(seq: Long, botUser: @@[User, BotUser], dmChannelMap: SnowflakeMap[DMChannel, DMChannel], groupDmChannelMap: SnowflakeMap[GroupDMChannel, GroupDMChannel], unavailableGuildMap: SnowflakeMap[Guild, UnavailableGuild], guildMap: SnowflakeMap[Guild, GatewayGuild], messageMap: SnowflakeMap[TextChannel, SnowflakeMap[Message, Message]], lastTypedMap: SnowflakeMap[TextChannel, SnowflakeMap[User, Instant]], userMap: SnowflakeMap[User, User], banMap: SnowflakeMap[Guild, SnowflakeMap[User, Ban]], processor: CacheProcessor) extends CacheSnapshotWithMaps with Product with Serializable
Represents the cache at some point in time
- class OptFuture[+A] extends AnyRef
A future that might be missing a value.
A future that might be missing a value. A nice wrapper around
Future[Option[A]]
- case class PubSubBufferSize(perProducer: Int = 16, consumer: Int = 256) extends Product with Serializable
- case class RequestCacheUpdate[Data](requestResponse: RequestResponse[Data], request: Request[Data], registry: CacheTypeRegistry) extends CacheEvent with Product with Serializable
A cache event that will try to put the data of the response into the cache.
A cache event that will try to put the data of the response into the cache.
- Data
The type of the request response.
- requestResponse
The response to the request.
- request
The request used to get the response.
- registry
The handler registry that the event will use to update the snapshot.
- class RequestPermissionException extends Exception
- case class RequestSettings(relativeTime: Boolean = false, parallelism: Int = 4, bufferSize: Int = 32, maxRetryCount: Int = 3, overflowStrategy: OverflowStrategy = OverflowStrategy.backpressure, maxAllowedWait: FiniteDuration = 2.minutes, maxRequestsPerSecond: Int = 50, counter404s: Boolean = true) extends Product with Serializable
- parallelism
Parallelism to use for requests.
- bufferSize
The buffer size to use for waiting requests.
- maxRetryCount
The maximum amount of times a request will be retried. Only affects requests that uses retries.
- overflowStrategy
The overflow strategy to use when the buffer is full.
- maxAllowedWait
The max allowed wait time before giving up on a request.
- maxRequestsPerSecond
Max amount of requests per second before the ratelimiter will assume it's globally ratelimited, and hold off on sending requests.
- counter404s
If the ratelimiter should keep track of previous 404s, and stop letting URIs with the same destination pass.
- type Requests = ackcord.requests.Requests
- type RequestsHelper = ackcord.requests.RequestsHelper
- class SnowflakeMap[K, +V] extends AbstractMap[SnowflakeType[K], V] with StrictOptimizedMapOps[SnowflakeType[K], V, Map, SnowflakeMap[K, V]] with Serializable
- type SourceRequest[A] = Source[A, NotUsed]
- type Streamable[F[_]] = ackcord.util.Streamable[F]
- trait TextChannelEventListenerMessage[A] extends ChannelEventListenerMessage[A]
- trait TextGuildChannelEventListenerMessage[A] extends TextChannelEventListenerMessage[A] with GuildEventListenerMessage[A]
- trait UserEventListenerMessage[A] extends EventListenerMessage[A]
- trait VGuildChannelEventListenerMessage[A] extends ChannelEventListenerMessage[A] with GuildEventListenerMessage[A]
- class WrappedEventListenerMessage[A] extends EventListenerMessage[A]
Deprecated Type Members
- trait RequestRunner[F[_]] extends AnyRef
- Annotations
- @deprecated
- Deprecated
(Since version 0.17) Prefer RequestHelper
Value Members
- val BotAuthentication: ackcord.requests.BotAuthentication.type
- val Cache: Events.type
- val GatewayLogin: Login.type
- val GatewayLogout: Logout.type
- val GatewaySettings: ackcord.gateway.GatewaySettings.type
- val JsonNull: ackcord.util.JsonNull.type
- val JsonOption: ackcord.util.JsonOption.type
- val JsonSome: ackcord.util.JsonSome.type
- val JsonUndefined: ackcord.util.JsonUndefined.type
- val Requests: ackcord.requests.Requests.type
- val Streamable: ackcord.util.Streamable.type
- implicit def flowFunctorInstance[In, Mat]: Functor[[β$0$]Flow[In, β$0$, Mat]]
- implicit def sinkContravariantInstance[Mat]: Contravariant[[α$1$]Sink[α$1$, Mat]]
- implicit val sourceMonadInstance: MonadError[SourceRequest, Throwable] with Alternative[SourceRequest]
- implicit def sourceSyntax[A, M](source: Source[A, M]): SourceFlatmap[A, M]
- object APIMessage
- object APIMessageCacheUpdate extends Serializable
- object AckCord
- object CacheEventCreator
- object CacheSnapshot
- object CacheStreams
- object ChannelEventListenerMessage
- object DiscordClientActor
- object DiscordShard
- object EventListenerBuilder extends Serializable
- object EventListenerMessage
- object EventRegistration extends Serializable
- object Events extends Serializable
- object GuildEventListenerMessage
- object GuildUserEventListenerMessage
- object MemoryCacheSnapshot extends Serializable
- object MusicManager
- object OptFuture
- object RequestCacheUpdate extends Serializable
- object RequestRunner
- object ShardShutdownManager
- object SnowflakeMap extends Serializable
- object TextChannelEventListenerMessage
- object TextGuildChannelEventListenerMessage
- object VGuildChannelEventListenerMessage