class Galileo::Client
- Galileo::Client
- Reference
- Object
Overview
Base dogehouse cilent to interface with api with
Defined in:
galileo/client.crConstructors
-
.new(token : String, refresh_token : String)
Client takes your dogehouse token and refreshToken in order to auth
Instance Method Summary
-
#all_callback : String -> Nil | Nil
All messages will be sent through this callback.
-
#all_callback=(all_callback : String -> Nil | Nil)
All messages will be sent through this callback.
-
#ask_to_speak
Ask to speak will request to speak in whatever room the bot is in
- #auth
-
#create_room(name : String, description : String = "", privacy : String = "public")
Will create room with given name description and privacy option Privacy options are limited to "public" and "private"
-
#delay : Int32
The chat delay withing rooms (measured in nanoseconds)
-
#delay=(delay : Int32)
The chat delay withing rooms (measured in nanoseconds)
- #get_rooms
-
#in_room : Bool
True if bot in room, False if not
-
#in_room=(in_room : Bool)
True if bot in room, False if not
-
#join_room(roomId : String)
Join room will join the room associated with a roomId
client.join_room "roomid"
-
#join_room_callback : Room -> Nil | Nil
When room is joined this callback will be called
client.on_room_join do |room| puts room.name end
-
#join_room_callback=(join_room_callback : Room -> Nil | Nil)
When room is joined this callback will be called
client.on_room_join do |room| puts room.name end
-
#message_callback : Message -> Nil | Nil
Optional message_callback property Add a message callback function with .on_message
client.on_message do |msg| puts msg end
-
#message_callback=(message_callback : Message -> Nil | Nil)
Optional message_callback property Add a message callback function with .on_message
client.on_message do |msg| puts msg end
-
#mute
Will mute
-
#muted : Bool
True if bot is muted, False if not
-
#muted=(muted : Bool)
True if bot is muted, False if not
-
#new_tokens_callback : String, String -> Nil | Nil
If newtokens are passed this callback will be called
client.on_new_tokens do |token, refresh_token| puts token end
-
#new_tokens_callback=(new_tokens_callback : String, String -> Nil | Nil)
If newtokens are passed this callback will be called
client.on_new_tokens do |token, refresh_token| puts token end
-
#on_all(&block : String -> Nil)
Add all callback All messages recieved in the client will be sent through this callback
client.on_all do |msg| puts msg end
-
#on_message(&block : Message -> Nil)
Add a message callback on_message takes block with context parameter and String parameter
client.on_message do |msg| puts msg end
-
#on_new_tokens(&block : String, String -> Nil)
Add new tokens callback
client.on_new_tokens do |token, refresh_token| puts token end
-
#on_ready(&block : User -> Nil)
Add ready callback
client.on_ready do |user| puts user.display_name end
-
#on_room_join(&block : Room -> Nil)
Add room join callback
client.on_room_join do |room| puts room.name end
-
#on_user_joined_room(&block : User -> Nil)
Add user joined room callback
client.on_user_joined_room do |user| puts user.display_name end
-
#raw_send(msg)
Send raw messages api without wrapper
-
#ready_callback : User -> Nil | Nil
Optional on ready callback property
client.on_ready do |user| puts user.display_name end
-
#ready_callback=(ready_callback : User -> Nil | Nil)
Optional on ready callback property
client.on_ready do |user| puts user.display_name end
-
#rooms : Array(Room)
Returns all the available rooms in array Updated every 2 seconds
-
#run
Run the client This will start the message loop
-
#send(message : String)
Sends message to whatever room currently in
client.send_message "msg"
-
#set_role(role : String, userId : String | Nil)
Takes a role "raised_hand", "listener", "speaker" and an optional userId which will default to the bot userId
- #set_speaking(b : Bool)
-
#speaking : Bool
If bot is speaking will be true else will be false
-
#toggle_mute
Will toggle mute on and off
-
#unmute
Will unmute
-
#user_joined_room_callback : User -> Nil | Nil
If a user joins a room this callback will be called
client.on_user_joined_room do |user| puts user.display_name end
-
#user_joined_room_callback=(user_joined_room_callback : User -> Nil | Nil)
If a user joins a room this callback will be called
client.on_user_joined_room do |user| puts user.display_name end
-
#ws : HTTP::WebSocket
Websocket connection state
-
#ws=(ws : HTTP::WebSocket)
Websocket connection state
Constructor Detail
Client takes your dogehouse token and refreshToken in order to auth
Instance Method Detail
All messages will be sent through this callback.
client.on_all do |msg|
puts msg
end
All messages will be sent through this callback.
client.on_all do |msg|
puts msg
end
Will create room with given name description and privacy option Privacy options are limited to "public" and "private"
Join room will join the room associated with a roomId
client.join_room "roomid"
When room is joined this callback will be called
client.on_room_join do |room|
puts room.name
end
When room is joined this callback will be called
client.on_room_join do |room|
puts room.name
end
Optional message_callback property Add a message callback function with .on_message
client.on_message do |msg|
puts msg
end
Optional message_callback property Add a message callback function with .on_message
client.on_message do |msg|
puts msg
end
If newtokens are passed this callback will be called
client.on_new_tokens do |token, refresh_token|
puts token
end
If newtokens are passed this callback will be called
client.on_new_tokens do |token, refresh_token|
puts token
end
Add all callback All messages recieved in the client will be sent through this callback
client.on_all do |msg|
puts msg
end
Add a message callback on_message takes block with context parameter and String parameter
client.on_message do |msg|
puts msg
end
Add new tokens callback
client.on_new_tokens do |token, refresh_token|
puts token
end
Add ready callback
client.on_ready do |user|
puts user.display_name
end
Add room join callback
client.on_room_join do |room|
puts room.name
end
Add user joined room callback
client.on_user_joined_room do |user|
puts user.display_name
end
Optional on ready callback property
client.on_ready do |user|
puts user.display_name
end
Optional on ready callback property
client.on_ready do |user|
puts user.display_name
end
Returns all the available rooms in array Updated every 2 seconds
Takes a role "raised_hand", "listener", "speaker" and an optional userId which will default to the bot userId
If a user joins a room this callback will be called
client.on_user_joined_room do |user|
puts user.display_name
end
If a user joins a room this callback will be called
client.on_user_joined_room do |user|
puts user.display_name
end