Skip to content

Message Class

CreativeBuilds edited this page Jul 16, 2019 · 4 revisions

Message Class


Can be found by listening to messages of a channel.

const Message = require("dlive-js/src/classes/Message");
new Message(dliveMessageObject, streamerBlockchainusername, streamerDliveUsername, permissionObj) // Returns a dlive-js Message Object

Properties

name returns description
id string dlive id for the message
content string A message of what the user said (if user message) or empty (if something like a follow)
type string the type of Message object, can be Follow, Message, or Gift
createdAt timestamp in ms the current time when the message was received by the client (not really the time the message was actually made)
streamerBlockchainUsername string an id of the streamer that cant be changed, and is their "lino username"
streamerDliveUsername string the displayname of the streamer of the Channel this Message came from
sender User returns a dlive-js User object of the user who sent the message
roomRole string the role of the user who sent the message in the room
role string the role of the user on dlive
isEmote boolean returns true if the message is an emote or not
isSubscribing boolean returns true if the user who sent the message is subbed to the channel or not

Functions

name returns description
getPermissionObj Function() -> PermissionObj returns the permission object that was passed into it on creation
reply Function(message) -> Promise sends a message back to that channel where the message was received.
delete Function() -> Promise returns a promise after sending a request to DLive to remove a message (only works if you're a mod or higher)

Clone this wiki locally