shimmer
Types
pub type ClientOptions {
ClientOptions(intents: List(Intent))
}
Constructors
-
ClientOptions(intents: List(Intent))
Functions
pub fn connect(client: Client(Message), handlers_builder: HandlersBuilder(
Message,
)) -> Result(Client(Message), ShimmerError)
Opens a websocket connection to the Discord Gateway. Passes this off to an actor to listen to messages.
pub fn connect_sharded(shards: ShardsManager(Message), handlers_builder: HandlersBuilder(
Message,
)) -> Result(ShardsManager(Message), ShimmerError)
Opens a sharded websocket connection to the Discord Gateway. Passes this off to an actor to listen to messages.
pub fn new(token: String) -> Client(Message)
Create a new client with the defualt setup, reccomended for most users
pub fn new_sharded(token: String) -> ShardsManager(Message)
Create a sharding manager to support larger bots, uses Client under the hood
pub fn new_sharded_with_opts(token: String, opts: ClientOptions) -> ShardsManager(
Message,
)
Create a new sharding manager with more control over the options, uses Client under the hood
pub fn new_with_opts(token: String, opts: ClientOptions) -> Client(
Message,
)
Create a new Shimmer Client with more control over the options
pub fn update_all_shards_presence(shards: ShardsManager(Message), presence: Presence) -> ShardsManager(
Message,
)
Update the presence of every client managed by the shards manager, returns the client to be used for future operations
Note you must call
connectbefore calling this function and do-not know if it has succeeded
pub fn update_all_shards_presence_from_builder(shards: ShardsManager(
Message,
), builder: PresenceBuilder) -> Result(
ShardsManager(Message),
ShimmerError,
)
Update the presence of every client managed by the shards manager, returns the client to be used for future operations
Note you must call
connectbefore calling this function and do-not know if it has succeeded Builds the presence from the builder and callsupdate_client_presence
pub fn update_client_presence(client: Client(Message), presence: Presence) -> Client(
Message,
)
Update the presence of the client, returns the client to be used for future operations
Note you must call
connectbefore calling this function and do-not know if it has succeeded
pub fn update_client_presence_from_builder(client: Client(Message), builder: PresenceBuilder) -> Result(
Client(Message),
ShimmerError,
)
Update the presence of the client, returns the client to be used for future operations
Note you must call
connectbefore calling this function and do-not know if it has succeeded Builds the presence from the builder and callsupdate_client_presence