trait DiscordClient extends AnyRef
Trait used to interface with Discord stuff from high level.
- Source
- DiscordClient.scala
- Alphabetic
- By Inheritance
- DiscordClient
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def commands: CommandConnector
The global commands object used by the client
- abstract def events: Events
Streams housing events and messages sent to and from Discord.
- abstract def login(): Unit
Login the shards of this client.
Login the shards of this client. Note that this method just sends the login signal. It does not block until a response is received.
- abstract def logout(timeout: FiniteDuration = 1.minute): Future[Boolean]
Logout the shards of this client
Logout the shards of this client
- timeout
The amount of time to wait before forcing logout.
- abstract def musicManager: Future[ActorRef[Command]]
- abstract def onEventStreamable[G[_]](handler: (CacheSnapshot) => PartialFunction[APIMessage, G[Unit]])(implicit streamable: Streamable[G]): EventRegistration[NotUsed]
Runs a function whenever APIMessage s are received.
Runs a function whenever APIMessage s are received.
If you use IntelliJ you might have to specify the execution type. (Normally Id, SourceRequest or Future)
- G
The execution type
- handler
The handler function
- streamable
A way to convert your execution type to a stream.
- returns
An event registration to handle the listener's lifecycle.
- abstract def registerListener[A <: APIMessage, Mat](listener: EventListener[A, Mat]): EventRegistration[Mat]
Registers an EventListener, created inside an EventsController.
Registers an EventListener, created inside an EventsController.
- A
The type events this listener takes.
- Mat
The materialized result of running the listener graph.
- listener
The listener to run
- returns
An event registration to handle the listener's lifecycle.
- abstract def requests: Requests
The low level requests object used by the client
- abstract val requestsHelper: RequestsHelper
The high level requests helper for use in user code.
- abstract def shards: Future[Seq[ActorRef[Command]]]
The shards of this client
- abstract def shutdownJVM(timeout: FiniteDuration = 1.minute): Future[Unit]
Logs out the shards of this client, and then shuts down the JVM.
Logs out the shards of this client, and then shuts down the JVM.
- timeout
The amount of time to wait for logout to succeed before forcing shutdown.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def bulkRegisterListeners(listeners: EventListener[_ <: APIMessage, NotUsed]*): Seq[(EventListener[_ <: APIMessage, NotUsed], EventRegistration[NotUsed])]
Starts many listeners at the same time.
Starts many listeners at the same time. They must all have a materialized value of NotUsed.
- listeners
The listeners to run.
- returns
The listeners together with their registrations.
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- implicit val executionContext: ExecutionContextExecutor
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def joinChannel(guildId: GuildId, channelId: VoiceGuildChannelId, createPlayer: => AudioPlayer, force: Boolean = false, timeoutDur: FiniteDuration = 30.seconds): Future[AudioPlayer]
Join a voice channel.
Join a voice channel.
- guildId
The guildId of the voice channel.
- channelId
The channelId of the voice channel.
- createPlayer
A named argument to create a player if one doesn't already exist.
- force
The the join should be force even if already connected to somewhere else (move channel).
- timeoutDur
The timeout duration before giving up,
- returns
A future containing the used player.
- def leaveChannel(guildId: GuildId, destroyPlayer: Boolean = false): Unit
Leave a voice channel.
Leave a voice channel.
- guildId
The guildId to leave the voice channel in.
- destroyPlayer
If the player used for this guild should be destroyed.
- def loadTrack(playerManager: AudioPlayerManager, identifier: String): Future[AudioItem]
Load a track using LavaPlayer.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def onEventAsync(handler: (CacheSnapshot) => PartialFunction[APIMessage, OptFuture[Unit]]): EventRegistration[NotUsed]
Runs an async function whenever APIMessage s are received.
Runs an async function whenever APIMessage s are received.
- handler
The handler function
- returns
An event registration to handle the listener's lifecycle.
- def onEventSideEffects(handler: (CacheSnapshot) => PartialFunction[APIMessage, Unit]): EventRegistration[NotUsed]
Runs a function whenever APIMessage s are received.
Runs a function whenever APIMessage s are received.
- handler
The handler function
- returns
An event registration to handle the listener's lifecycle.
- def onEventSideEffectsIgnore(handler: PartialFunction[APIMessage, Unit]): EventRegistration[NotUsed]
Runs a function whenever APIMessage s are received without the cache snapshot.
Runs a function whenever APIMessage s are received without the cache snapshot.
- handler
The handler function
- returns
An event registration to handle the listener's lifecycle.
- def runGatewayCommands(clientId: String)(commands: CreatedApplicationCommand*): Unit
Listen for the specified commands from the gateway.
- def setPlaying(guildId: GuildId, playing: Boolean): Unit
Set a bot as speaking/playing in a channel.
Set a bot as speaking/playing in a channel. This is required before sending any sound.
- def shutdownAckCord(timeout: FiniteDuration = 1.minute): Future[Unit]
Logs out the shards of this client, and then shuts down the actor system.
Logs out the shards of this client, and then shuts down the actor system.
- timeout
The amount of time to wait for logout to succeed before forcing shutdown.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- implicit val system: ActorSystem[Nothing]
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])