t

ackcord

DiscordClient

trait DiscordClient extends AnyRef

Trait used to interface with Discord stuff from high level.

Source
DiscordClient.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DiscordClient
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def commands: CommandConnector

    The global commands object used by the client

  2. abstract def events: Events

    Streams housing events and messages sent to and from Discord.

  3. 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.

  4. 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.

  5. abstract def musicManager: Future[ActorRef[Command]]
  6. 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.

  7. 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.

  8. abstract def requests: Requests

    The low level requests object used by the client

  9. abstract val requestsHelper: RequestsHelper

    The high level requests helper for use in user code.

  10. abstract def shards: Future[Seq[ActorRef[Command]]]

    The shards of this client

  11. 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

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. 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.

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. implicit val executionContext: ExecutionContextExecutor
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. 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.

  14. 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.

  15. def loadTrack(playerManager: AudioPlayerManager, identifier: String): Future[AudioItem]

    Load a track using LavaPlayer.

  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  19. 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.

  20. 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.

  21. 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.

  22. def runGatewayCommands(clientId: String)(commands: CreatedApplicationCommand*): Unit

    Listen for the specified commands from the gateway.

  23. 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.

  24. 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.

  25. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  26. implicit val system: ActorSystem[Nothing]
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def cache: Events
    Annotations
    @deprecated
    Deprecated

    (Since version 0.17) Prefer events

  2. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped