Take control over your live stream video by running it yourself. Streaming + chat out of the box.
HTML activitypubbroadcastingchatdecentralizedfederationfediversegolanghacktoberfesthlslivelivestreamowncastrtmpself-hostedstreaming-videovideo
Add an icon for bot messages. Closes #1172 (#1729)
Gabe Kangas06e377eefca1
diff --git a/controllers/admin/chat.go b/controllers/admin/chat.goindex 91bdba1323..7310532247 100644--- a/controllers/admin/chat.go+++ b/controllers/admin/chat.go@@ -235,6 +235,7 @@ func SendIntegrationChatMessage(integration user.ExternalAPIUser, w http.ResponsDisplayName: name,DisplayColor: integration.DisplayColor,CreatedAt: integration.CreatedAt,+ IsBot: true,}if err := chat.Broadcast(&event); err != nil {diff --git a/core/chat/persistence.go b/core/chat/persistence.goindex 684e272402..96c00d9b5e 100644--- a/core/chat/persistence.go+++ b/core/chat/persistence.go@@ -99,6 +99,9 @@ func makeUserMessageEventFromRowData(row rowData) events.UserMessageEvent {createdAt = *row.userCreatedAt}+ isBot := (row.userType != nil && *row.userType == "API")+ scopeSlice := strings.Split(scopes, ",")+u := user.User{ID: *row.userID,AccessToken: "",@@ -108,7 +111,8 @@ func makeUserMessageEventFromRowData(row rowData) events.UserMessageEvent {DisabledAt: row.userDisabledAt,NameChangedAt: row.userNameChangedAt,PreviousNames: previousUsernames,- Scopes: strings.Split(scopes, ","),+ Scopes: scopeSlice,+ IsBot: isBot,}message := events.UserMessageEvent{@@ -197,6 +201,7 @@ type rowData struct {previousUsernames *stringuserNameChangedAt *time.TimeuserScopes *string+ userType *string}func getChat(query string) []interface{} {@@ -230,6 +235,7 @@ func getChat(query string) []interface{} {&row.previousUsernames,&row.userNameChangedAt,&row.userScopes,+ &row.userType,); err != nil {log.Errorln("There is a problem converting query to chat objects. Please report this:", query)break@@ -267,7 +273,7 @@ func GetChatModerationHistory() []interface{} {}// Get all messages regardless of visibility- query := "SELECT messages.id, user_id, body, title, subtitle, image, link, eventType, hidden_at, timestamp, display_name, display_color, created_at, disabled_at, previous_names, namechanged_at, scopes FROM messages INNER JOIN users ON messages.user_id = users.id ORDER BY timestamp DESC"+ query := "SELECT messages.id, user_id, body, title, subtitle, image, link, eventType, hidden_at, timestamp, display_name, display_color, created_at, disabled_at, previous_names, namechanged_at, scopes, users.type FROM messages INNER JOIN users ON messages.user_id = users.id ORDER BY timestamp DESC"result := getChat(query)_historyCache = &result@@ -278,7 +284,7 @@ func GetChatModerationHistory() []interface{} {// GetChatHistory will return all the chat messages suitable for returning as user-facing chat history.func GetChatHistory() []interface{} {// Get all visible messages- query := fmt.Sprintf("SELECT messages.id,messages.user_id, messages.body, messages.title, messages.subtitle, messages.image, messages.link, messages.eventType, messages.hidden_at, messages.timestamp, users.display_name, users.display_color, users.created_at, users.disabled_at, users.previous_names, users.namechanged_at, users.scopes FROM messages LEFT JOIN users ON messages.user_id = users.id WHERE hidden_at IS NULL AND disabled_at IS NULL ORDER BY timestamp DESC LIMIT %d", maxBacklogNumber)+ query := fmt.Sprintf("SELECT messages.id,messages.user_id, messages.body, messages.title, messages.subtitle, messages.image, messages.link, messages.eventType, messages.hidden_at, messages.timestamp, users.display_name, users.display_color, users.created_at, users.disabled_at, users.previous_names, users.namechanged_at, users.scopes, users.type FROM messages LEFT JOIN users ON messages.user_id = users.id WHERE hidden_at IS NULL AND disabled_at IS NULL ORDER BY timestamp DESC LIMIT %d", maxBacklogNumber)m := getChat(query)// Invert order of messages@@ -298,7 +304,7 @@ func SetMessageVisibilityForUserID(userID string, visible bool) error {// Get a list of IDs to send to the connected clients to hideids := make([]string, 0)- query := fmt.Sprintf("SELECT messages.id, user_id, body, title, subtitle, image, link, eventType, hidden_at, timestamp, display_name, display_color, created_at, disabled_at, previous_names, namechanged_at, scopes FROM messages INNER JOIN users ON messages.user_id = users.id WHERE user_id IS '%s'", userID)+ query := fmt.Sprintf("SELECT messages.id, user_id, body, title, subtitle, image, link, eventType, hidden_at, timestamp, display_name, display_color, created_at, disabled_at, previous_names, namechanged_at, scopes, type FROM messages INNER JOIN users ON messages.user_id = users.id WHERE user_id IS '%s'", userID)messages := getChat(query)if len(messages) == 0 {diff --git a/core/user/externalAPIUser.go b/core/user/externalAPIUser.goindex f4323232e6..c3f3fc9567 100644--- a/core/user/externalAPIUser.go+++ b/core/user/externalAPIUser.go@@ -22,6 +22,7 @@ type ExternalAPIUser struct {Scopes []string `json:"scopes"`Type string `json:"type,omitempty"` // Should be APILastUsedAt *time.Time `json:"lastUsedAt,omitempty"`+ IsBot bool `json:"isBot"`}const (@@ -240,6 +241,7 @@ func makeExternalAPIUsersFromRows(rows *sql.Rows) ([]ExternalAPIUser, error) {CreatedAt: createdAt,Scopes: strings.Split(scopes, ","),LastUsedAt: lastUsedAt,+ IsBot: true,}integrations = append(integrations, integration)}diff --git a/core/user/user.go b/core/user/user.goindex 218cb3d187..c546f98891 100644--- a/core/user/user.go+++ b/core/user/user.go@@ -16,8 +16,10 @@ import (var _datastore *data.Datastore-const moderatorScopeKey = "MODERATOR"-const minSuggestedUsernamePoolLength = 10+const (+ moderatorScopeKey = "MODERATOR"+ minSuggestedUsernamePoolLength = 10+)// User represents a single chat user.type User struct {@@ -29,7 +31,8 @@ type User struct {DisabledAt *time.Time `json:"disabledAt,omitempty"`PreviousNames []string `json:"previousNames"`NameChangedAt *time.Time `json:"nameChangedAt,omitempty"`- Scopes []string `json:"scopes"`+ Scopes []string `json:"scopes,omitempty"`+ IsBot bool `json:"isBot"`}// IsEnabled will return if this single user is enabled.diff --git a/test/automated/api/integrations.test.js b/test/automated/api/integrations.test.jsindex e3357e56dd..d9d7d4a515 100644--- a/test/automated/api/integrations.test.js+++ b/test/automated/api/integrations.test.js@@ -8,171 +8,170 @@ const webhook = 'https://super.duper.cool.thing.biz/owncast';const events = ['CHAT'];test('create webhook', async (done) => {- const res = await sendIntegrationsChangePayload('webhooks/create', {- url: webhook,- events: events,- });-- expect(res.body.url).toBe(webhook);- expect(res.body.timestamp).toBeTruthy();- expect(res.body.events).toStrictEqual(events);- done();+ const res = await sendIntegrationsChangePayload('webhooks/create', {+ url: webhook,+ events: events,+ });++ expect(res.body.url).toBe(webhook);+ expect(res.body.timestamp).toBeTruthy();+ expect(res.body.events).toStrictEqual(events);+ done();});test('check webhooks', (done) => {- request- .get('/api/admin/webhooks')- .auth('admin', 'abc123')- .expect(200)- .then((res) => {- expect(res.body).toHaveLength(1);- expect(res.body[0].url).toBe(webhook);- expect(res.body[0].events).toStrictEqual(events);- webhookID = res.body[0].id;- done();- });+ request+ .get('/api/admin/webhooks')+ .auth('admin', 'abc123')+ .expect(200)+ .then((res) => {+ expect(res.body).toHaveLength(1);+ expect(res.body[0].url).toBe(webhook);+ expect(res.body[0].events).toStrictEqual(events);+ webhookID = res.body[0].id;+ done();+ });});test('delete webhook', async (done) => {- const res = await sendIntegrationsChangePayload('webhooks/delete', {- id: webhookID,- });- expect(res.body.success).toBe(true);- done();+ const res = await sendIntegrationsChangePayload('webhooks/delete', {+ id: webhookID,+ });+ expect(res.body.success).toBe(true);+ done();});test('check that webhook was deleted', (done) => {- request- .get('/api/admin/webhooks')- .auth('admin', 'abc123')- .expect(200)- .then((res) => {- expect(res.body).toHaveLength(0);- done();- });+ request+ .get('/api/admin/webhooks')+ .auth('admin', 'abc123')+ .expect(200)+ .then((res) => {+ expect(res.body).toHaveLength(0);+ done();+ });});test('create access token', async (done) => {- const name = 'Automated integration test';- const scopes = [- 'CAN_SEND_SYSTEM_MESSAGES',- 'CAN_SEND_MESSAGES',- 'HAS_ADMIN_ACCESS',- ];- const res = await sendIntegrationsChangePayload('accesstokens/create', {- name: name,- scopes: scopes,- });-- expect(res.body.accessToken).toBeTruthy();- expect(res.body.createdAt).toBeTruthy();- expect(res.body.displayName).toBe(name);- expect(res.body.scopes).toStrictEqual(scopes);- accessToken = res.body.accessToken;-- done();+ const name = 'Automated integration test';+ const scopes = [+ 'CAN_SEND_SYSTEM_MESSAGES',+ 'CAN_SEND_MESSAGES',+ 'HAS_ADMIN_ACCESS',+ ];+ const res = await sendIntegrationsChangePayload('accesstokens/create', {+ name: name,+ scopes: scopes,+ });++ expect(res.body.accessToken).toBeTruthy();+ expect(res.body.createdAt).toBeTruthy();+ expect(res.body.displayName).toBe(name);+ expect(res.body.scopes).toStrictEqual(scopes);+ accessToken = res.body.accessToken;++ done();});test('check access tokens', async (done) => {- const res = await request- .get('/api/admin/accesstokens')- .auth('admin', 'abc123')- .expect(200);- const tokenCheck = res.body.filter(- (token) => token.accessToken === accessToken- );- expect(tokenCheck).toHaveLength(1);- done();+ const res = await request+ .get('/api/admin/accesstokens')+ .auth('admin', 'abc123')+ .expect(200);+ const tokenCheck = res.body.filter(+ (token) => token.accessToken === accessToken+ );+ expect(tokenCheck).toHaveLength(1);+ done();});test('send a system message using access token', async (done) => {- const payload = {- body: 'This is a test system message from the automated integration test',- };- const res = await request- .post('/api/integrations/chat/system')- .set('Authorization', 'Bearer ' + accessToken)- .send(payload)- .expect(200);- done();+ const payload = {+ body: 'This is a test system message from the automated integration test',+ };+ const res = await request+ .post('/api/integrations/chat/system')+ .set('Authorization', 'Bearer ' + accessToken)+ .send(payload)+ .expect(200);+ done();});test('send an external integration message using access token', async (done) => {- const payload = {- body: 'This is a test external message from the automated integration test',- };- const res = await request- .post('/api/integrations/chat/send')- .set('Authorization', 'Bearer ' + accessToken)- .send(payload)- .expect(200);- done();+ const payload = {+ body: 'This is a test external message from the automated integration test',+ };+ const res = await request+ .post('/api/integrations/chat/send')+ .set('Authorization', 'Bearer ' + accessToken)+ .send(payload)+ .expect(200);+ done();});test('send an external integration action using access token', async (done) => {- const payload = {- body: 'This is a test external action from the automated integration test',- };- const res = await request- .post('/api/integrations/chat/action')- .set('Authorization', 'Bearer ' + accessToken)- .send(payload)- .expect(200);- done();+ const payload = {+ body: 'This is a test external action from the automated integration test',+ };+ const res = await request+ .post('/api/integrations/chat/action')+ .set('Authorization', 'Bearer ' + accessToken)+ .send(payload)+ .expect(200);+ done();});test('test fetch chat history using access token', async (done) => {- const res = await request- .get('/api/integrations/chat')- .set('Authorization', 'Bearer ' + accessToken)- .expect(200);- done();+ const res = await request+ .get('/api/integrations/chat')+ .set('Authorization', 'Bearer ' + accessToken)+ .expect(200);+ done();});-test('test fetch chat history failure using invalid access token', async (done) => {- const res = await request- .get('/api/integrations/chat')- .set('Authorization', 'Bearer ' + 'invalidToken')- .expect(401);- done();+ const res = await request+ .get('/api/integrations/chat')+ .set('Authorization', 'Bearer ' + 'invalidToken')+ .expect(401);+ done();});test('test fetch chat history OPTIONS request', async (done) => {- const res = await request- .options('/api/integrations/chat')- .set('Authorization', 'Bearer ' + accessToken)- .expect(204);- done();+ const res = await request+ .options('/api/integrations/chat')+ .set('Authorization', 'Bearer ' + accessToken)+ .expect(204);+ done();});test('delete access token', async (done) => {- const res = await sendIntegrationsChangePayload('accesstokens/delete', {- token: accessToken,- });- expect(res.body.success).toBe(true);- done();+ const res = await sendIntegrationsChangePayload('accesstokens/delete', {+ token: accessToken,+ });+ expect(res.body.success).toBe(true);+ done();});test('check token delete was successful', async (done) => {- const res = await request- .get('/api/admin/accesstokens')- .auth('admin', 'abc123')- .expect(200);- const tokenCheck = res.body.filter(- (token) => token.accessToken === accessToken- );- expect(tokenCheck).toHaveLength(0);- done();+ const res = await request+ .get('/api/admin/accesstokens')+ .auth('admin', 'abc123')+ .expect(200);+ const tokenCheck = res.body.filter(+ (token) => token.accessToken === accessToken+ );+ expect(tokenCheck).toHaveLength(0);+ done();});async function sendIntegrationsChangePayload(endpoint, payload) {- const url = '/api/admin/' + endpoint;- const res = await request- .post(url)- .auth('admin', 'abc123')- .send(payload)- .expect(200);-- return res;+ const url = '/api/admin/' + endpoint;+ const res = await request+ .post(url)+ .auth('admin', 'abc123')+ .send(payload)+ .expect(200);++ return res;}diff --git a/webroot/img/bot.svg b/webroot/img/bot.svgnew file mode 100644index 0000000000..0f1d8c1ff1--- /dev/null+++ b/webroot/img/bot.svg@@ -0,0 +1,2 @@+<?xml version="1.0"?>+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svgjs="http://svgjs.com/svgjs" version="1.1" width="512" height="512" x="0" y="0" viewBox="0 0 426 426.80995" style="enable-background:new 0 0 512 512" xml:space="preserve" class=""><g><g xmlns="http://www.w3.org/2000/svg" fill="#90caf9"><path d="m304.40625 32.144531c0 8.835938-7.164062 16-16 16s-16-7.164062-16-16c0-8.835937 7.164062-16 16-16s16 7.164063 16 16zm0 0" fill="#d6bbff" data-original="#90caf9" class=""/><path d="m155.070312 32.144531c0 8.835938-7.164062 16-16 16-8.835937 0-16-7.164062-16-16 0-8.835937 7.164063-16 16-16 8.835938 0 16 7.164063 16 16zm0 0" fill="#d6bbff" data-original="#90caf9" class=""/><path d="m32.40625 261.476562c-8.832031-.007812-15.992188-7.167968-16-16v-42.667968c.007812-8.832032 7.167969-15.988282 16-16h16v74.667968zm0 0" fill="#d6bbff" data-original="#90caf9" class=""/><path d="m379.070312 261.476562v-74.667968h16c8.832032.011718 15.992188 7.167968 16 16v42.667968c-.007812 8.832032-7.167968 15.992188-16 16zm0 0" fill="#d6bbff" data-original="#90caf9" class=""/></g><path xmlns="http://www.w3.org/2000/svg" d="m165.738281 362.808594c.015625-1.417969-.542969-2.78125-1.546875-3.785156-1.003906-1.003907-2.367187-1.5625-3.785156-1.546876h-64c-20.609375-.023437-37.3125-16.722656-37.335938-37.332031v-181.335937c.023438-20.609375 16.726563-37.308594 37.335938-37.332032h234.664062c20.609376.023438 37.308594 16.726563 37.335938 37.332032v181.335937c-.027344 20.605469-16.726562 37.308594-37.335938 37.332031h-85.332031c-1.035156.011719-2.050781.308594-2.933593.851563l-77.066407 48.183594zm-26.667969-96.019532c-2.480468.011719-4.625 1.726563-5.1875 4.140626-.558593 2.417968.617188 4.902343 2.84375 6 24.074219 11.320312 50.410157 17.015624 77.011719 16.652343 26.605469.363281 52.941407-5.332031 77.019531-16.65625 2.21875-1.101562 3.386719-3.582031 2.824219-5.996093-.558593-2.410157-2.703125-4.121094-5.175781-4.136719-.816406.003906-1.617188.195312-2.339844.570312-22.613281 10.585938-47.339844 15.898438-72.308594 15.527344-24.972656.367187-49.699218-4.9375-72.324218-15.519531-.730469-.378906-1.539063-.578125-2.363282-.582032zm128-101.3125c8.832032.007813 15.992188 7.167969 16 16 0 2.945313 2.390626 5.332032 5.335938 5.332032s5.332031-2.386719 5.332031-5.332032c0-14.726562-11.9375-26.667968-26.667969-26.667968-14.726562 0-26.664062 11.941406-26.664062 26.667968 0 2.945313 2.386719 5.332032 5.332031 5.332032 2.945313 0 5.332031-2.386719 5.332031-5.332032.011719-8.832031 7.167969-15.992187 16-16zm-106.664062 0c8.832031.007813 15.988281 7.167969 16 16 0 2.945313 2.386719 5.332032 5.332031 5.332032 2.945313 0 5.332031-2.386719 5.332031-5.332032 0-14.726562-11.9375-26.667968-26.664062-26.667968-14.730469 0-26.667969 11.941406-26.667969 26.667968 0 2.945313 2.386719 5.332032 5.332031 5.332032 2.945313 0 5.335938-2.386719 5.335938-5.332032.007812-8.832031 7.167969-15.992187 16-16zm0 0" fill="#c1a4eb" data-original="#42a5f5" class=""/><path xmlns="http://www.w3.org/2000/svg" d="m139.070312 192.144531c2.832032.007813 5.550782-1.113281 7.554688-3.113281 2.003906-2.003906 3.125-4.722656 3.113281-7.554688 0-5.890624 4.777344-10.667968 10.667969-10.667968s10.664062 4.777344 10.664062 10.667968c0 5.890626 4.777344 10.667969 10.667969 10.667969s10.667969-4.777343 10.667969-10.667969c0-17.671874-14.328125-32-32-32-17.675781 0-32 14.328126-32 32-.011719 2.832032 1.109375 5.550782 3.113281 7.554688 2 2 4.71875 3.121094 7.550781 3.113281zm0 0" fill="#000000" data-original="#1976d2" class=""/><path xmlns="http://www.w3.org/2000/svg" d="m283.660156 262.597656c-39.84375 19.945313-99.949218 19.945313-139.84375 0-5.269531-2.621094-11.667968-.472656-14.292968 4.800782-2.621094 5.269531-.472657 11.671874 4.800781 14.292968 24.816406 11.710938 51.976562 17.605469 79.414062 17.226563 27.4375.378906 54.597657-5.515625 79.414063-17.226563 5.273437-2.621094 7.421875-9.023437 4.800781-14.292968-2.621094-5.273438-9.023437-7.421876-14.292969-4.800782zm0 0" fill="#000000" data-original="#1976d2" class=""/><path xmlns="http://www.w3.org/2000/svg" d="m395.070312 170.808594h-10.664062v-32c-.011719-29.449219-23.882812-53.320313-53.335938-53.332032h-32v-23.308593c14.695313-5.191407 23.507813-20.21875 20.875-35.578125-2.636718-15.363282-15.957031-26.589844-31.539062-26.589844-15.585938 0-28.90625 11.226562-31.539062 26.589844-2.636719 15.359375 6.175781 30.386718 20.871093 35.578125v23.308593h-128v-23.308593c14.695313-5.191407 23.507813-20.21875 20.871094-35.578125-2.632813-15.363282-15.953125-26.589844-31.539063-26.589844-15.582031 0-28.902343 11.226562-31.539062 26.589844-2.632812 15.359375 6.179688 30.386718 20.875 35.578125v23.308593h-32c-29.445312.03125-53.304688 23.890626-53.335938 53.332032v32h-10.664062c-17.667969.015625-31.988281 14.335937-32 32v42.667968c.011719 17.667969 14.332031 31.984376 32 32h10.664062v42.667969c.03125 29.441407 23.890626 53.300781 53.335938 53.332031h53.332031v42.667969c.007813 3.871094 2.113281 7.4375 5.5 9.320313 3.386719 1.878906 7.527344 1.785156 10.820313-.253906l82.71875-51.734376h82.292968c29.453126-.011718 53.324219-23.882812 53.335938-53.332031v-42.667969h10.664062c17.667969-.015624 31.988282-14.332031 32-32v-42.667968c-.011718-17.664063-14.332031-31.984375-32-32zm-352 85.335937h-10.664062c-5.886719-.019531-10.652344-4.785156-10.667969-10.667969v-42.667968c.015625-5.882813 4.78125-10.648438 10.667969-10.664063h10.664062zm245.335938-234.667969c5.890625 0 10.664062 4.777344 10.664062 10.667969s-4.773437 10.664063-10.664062 10.664063-10.667969-4.773438-10.667969-10.664063c.015625-5.886719 4.78125-10.652343 10.667969-10.667969zm-149.335938 0c5.890626 0 10.667969 4.777344 10.667969 10.667969s-4.777343 10.664063-10.667969 10.664063c-5.890624 0-10.664062-4.773438-10.664062-10.664063.015625-5.886719 4.78125-10.652343 10.664062-10.667969zm224 298.667969c-.011718 17.664063-14.332031 31.984375-32 32h-85.332031c-1.996093.011719-3.949219.5625-5.652343 1.597657l-69.015626 43.148437v-34.082031c.011719-2.832032-1.109374-5.550782-3.113281-7.550782-2-2.003906-4.71875-3.125-7.550781-3.113281h-64c-17.667969-.015625-31.988281-14.335937-32-32v-181.335937c.011719-17.664063 14.332031-31.984375 32-32h234.664062c17.667969.015625 31.988282 14.335937 32 32zm42.667969-74.667969c-.015625 5.882813-4.78125 10.648438-10.667969 10.667969h-10.664062v-64h10.664062c5.886719.015625 10.652344 4.78125 10.667969 10.664063zm0 0" fill="#000000" data-original="#1976d2" class=""/><path xmlns="http://www.w3.org/2000/svg" d="m267.070312 149.476562c-17.664062.015626-31.984374 14.332032-32 32 0 5.890626 4.777344 10.667969 10.667969 10.667969s10.667969-4.777343 10.667969-10.667969c0-5.890624 4.773438-10.667968 10.664062-10.667968 5.890626 0 10.667969 4.777344 10.667969 10.667968 0 5.890626 4.777344 10.667969 10.667969 10.667969s10.664062-4.777343 10.664062-10.667969c-.011718-17.667968-14.332031-31.984374-32-32zm0 0" fill="#000000" data-original="#1976d2" class=""/></g></svg>diff --git a/webroot/js/components/chat/chat-message-view.js b/webroot/js/components/chat/chat-message-view.jsindex 1ff813c574..a6dcd40299 100644--- a/webroot/js/components/chat/chat-message-view.js+++ b/webroot/js/components/chat/chat-message-view.js@@ -51,7 +51,7 @@ export default class ChatMessageView extends Component {return null;}- const { displayName, displayColor, createdAt } = user;+ const { displayName, displayColor, createdAt, isBot } = user;const isAuthorModerator = checkIsModerator(message);const isMessageModeratable =@@ -88,6 +88,15 @@ export default class ChatMessageView extends Component {/>`: null;+ const isBotFlair = isBot+ ? html`<img+ title="Bot"+ class="inline-block mr-1 w-4 h-4 relative"+ style=${{ bottom: '1px' }}+ src="/img/bot.svg"+ />`+ : null;+return html`<divstyle=${backgroundStyle}@@ -100,7 +109,7 @@ export default class ChatMessageView extends Component {class="message-author font-bold"title=${userMetadata}>- ${messageAuthorFlair} ${displayName}+ ${isBotFlair} ${messageAuthorFlair} ${displayName}</div>${isMessageModeratable &&html`<${ModeratorActions}diff --git a/webroot/js/components/chat/message.js b/webroot/js/components/chat/message.jsindex aa1d11c4f4..ae35a23670 100644--- a/webroot/js/components/chat/message.js+++ b/webroot/js/components/chat/message.js@@ -99,7 +99,7 @@ export default function Message(props) {`;return html`<${SystemMessage} contents=${contents} />`;} else if (type === SOCKET_MESSAGE_TYPES.USER_JOINED) {- const { displayName } = user;+ const { displayName, isBot } = user;const isAuthorModerator = checkIsModerator(message);const messageAuthorFlair = isAuthorModerator? html`<img@@ -108,6 +108,7 @@ export default function Message(props) {src="/img/moderator-nobackground.svg"/>`: null;+const contents = html`<div><span class="font-bold">${messageAuthorFlair}${displayName}</span>${' '}joined the chat.