Skip to content

Commit 88c3558

Browse files
committed
fix(discord): hide empty tags
1 parent aac9d98 commit 88c3558

1 file changed

Lines changed: 20 additions & 24 deletions

File tree

src/integrations/discord.ts

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,10 @@
1-
import { AppDataSource } from '~/database';
2-
import { isStreamOnline, stats } from '~/helpers/api';
3-
import { attributesReplace } from '~/helpers/attributesReplace';
4-
import {
5-
announceTypes, getOwner, getUserSender, isUUID, prepare,
6-
} from '~/helpers/commons';
7-
import { isBotStarted, isDbConnected } from '~/helpers/database';
8-
import { debounce } from '~/helpers/debounce';
9-
101
import { DiscordLink } from '@entity/discord';
11-
12-
import { eventEmitter } from '~/helpers/events';
13-
142
import { Events } from '@entity/event';
15-
16-
import {
17-
chatIn, chatOut, debug, error, info, warning, whisperOut,
18-
} from '~/helpers/log';
19-
203
import { Permissions as PermissionsEntity } from '@entity/permissions';
21-
22-
import { check } from '~/helpers/permissions/check';
23-
244
import { User } from '@entity/user';
255

26-
import { get as getPermission } from '~/helpers/permissions/get';
27-
286
import { HOUR, MINUTE } from '@sogebot/ui-helpers/constants';
297

30-
import { adminEndpoint } from '~/helpers/socket';
31-
328
import { dayjs, timezone } from '@sogebot/ui-helpers/dayjsHelper';
339

3410
import * as changelog from '~/helpers/user/changelog.js';
@@ -56,6 +32,21 @@ import Expects from '../expects';
5632
import { Message } from '../message';
5733
import Parser from '../parser';
5834
import users from '../users';
35+
import { AppDataSource } from '~/database';
36+
import { isStreamOnline, stats } from '~/helpers/api';
37+
import { attributesReplace } from '~/helpers/attributesReplace';
38+
import {
39+
announceTypes, getOwner, getUserSender, isUUID, prepare,
40+
} from '~/helpers/commons';
41+
import { isBotStarted, isDbConnected } from '~/helpers/database';
42+
import { debounce } from '~/helpers/debounce';
43+
import { eventEmitter } from '~/helpers/events';
44+
import {
45+
chatIn, chatOut, debug, error, info, warning, whisperOut,
46+
} from '~/helpers/log';
47+
import { check } from '~/helpers/permissions/check';
48+
import { get as getPermission } from '~/helpers/permissions/get';
49+
import { adminEndpoint } from '~/helpers/socket';
5950

6051
class Discord extends Integration {
6152
client: DiscordJs.Client | null = null;
@@ -370,6 +361,11 @@ class Discord extends Integration {
370361
if (o === '$subscribers' && broadcasterType !== '') {
371362
return false;
372363
}
364+
365+
if (o === '$tags' && (stats.value.currentTags ?? []).length === 0) {
366+
// don't show empty tags
367+
return false;
368+
}
373369
return true;
374370
}
375371

0 commit comments

Comments
 (0)