ChatText
Event triggered upon new text message (or sticker)
The ChatText event triggers upon a new text message or sticker (technically just a text message)
const bot = new Dlive(key);
bot.on('ChatText', msg => {
console.log(`[${msg.sender.displayname}]: ${msg.content}`);
});
[LKD70]: Hello!
{
"__typename": "ChatText",
"type": "Message",
"id": "f33efd66-1d12-470f-bf81-02f54948d418",
"content": "Hello!",
"createdAt": "1557936329547722026",
"sender": {
"__typename": "StreamchatUser",
"id": "streamchatuser:dlive-16407341",
"username": "dlive-16407341",
"displayname": "LKD70",
"avatar": "https://images.prd.dlivecdn.com/avatar/6f9c4ac4-73d8-11e9-a383-66bb2e204db6",
"partnerStatus": "NONE",
"badges": []
},
"role": "None",
"roomRole": "Owner",
"subscribing": false
}
Updated over 5 years ago