mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-09-16 01:21:20 -04:00
don't announce first mode change
This commit is contained in:
@@ -36,6 +36,7 @@ const client = new Client({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const channelCache = new Map();
|
const channelCache = new Map();
|
||||||
|
let skippedFirstModeAnnouncement = false;
|
||||||
|
|
||||||
function sanitizeMentions(text) {
|
function sanitizeMentions(text) {
|
||||||
if (!text) return '';
|
if (!text) return '';
|
||||||
@@ -268,6 +269,11 @@ function handleBusEvent(event) {
|
|||||||
const roles = discordConfig.roles || {};
|
const roles = discordConfig.roles || {};
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'mode.changed':
|
case 'mode.changed':
|
||||||
|
if (!skippedFirstModeAnnouncement) {
|
||||||
|
skippedFirstModeAnnouncement = true;
|
||||||
|
updatePresence();
|
||||||
|
break;
|
||||||
|
}
|
||||||
announce({
|
announce({
|
||||||
channelId: channels.announcements,
|
channelId: channels.announcements,
|
||||||
pingRoleId: roles.announcementPing || null,
|
pingRoleId: roles.announcementPing || null,
|
||||||
|
|||||||
Reference in New Issue
Block a user