Skip to content

Commit d0c7d64

Browse files
committed
chore: remove other phrases integration stuff
1 parent a44d68f commit d0c7d64

File tree

6 files changed

+0
-55
lines changed

6 files changed

+0
-55
lines changed

index.js

-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ services
7070
services.scheduledCommands,
7171
services.fakeScheduler,
7272
services.messageRelay,
73-
services.bannedPhrases,
7473
);
7574
chatServiceRouter.create();
7675
})

lib/chat-utils/parse-commands-from-chat.js

-10
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,6 @@ function parseCommand(message) {
6060
return { commandString: commandString.toLowerCase(), input };
6161
}
6262

63-
function formatAddPhrase(phrase) {
64-
return `ADDPHRASE ${JSON.stringify({ data: phrase })}`;
65-
}
66-
67-
function formatRemovePhrase(phrase) {
68-
return `REMOVEPHRASE ${JSON.stringify({ data: phrase })}`;
69-
}
70-
7163
module.exports = {
7264
parseMessage,
7365
parseCommand,
@@ -79,6 +71,4 @@ module.exports = {
7971
formatPoll,
8072
parseWhisper,
8173
formatWhisper,
82-
formatAddPhrase,
83-
formatRemovePhrase,
8474
};

lib/message-routing/chat-service-router.js

-15
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class ChatServiceRouter {
1111
messageSchedulerStream,
1212
fakeScheduler,
1313
messageRelay,
14-
bannedPhrases,
1514
) {
1615
this.messageRouter = messageRouter;
1716
this.commandRouter = commandRouter;
@@ -23,7 +22,6 @@ class ChatServiceRouter {
2322
this.fakeScheduler = fakeScheduler;
2423
// TODO just refactor other things to use the message relay
2524
this.messageRelay = messageRelay;
26-
this.bannedPhrases = bannedPhrases;
2725
}
2826

2927
create() {
@@ -162,19 +160,6 @@ class ChatServiceRouter {
162160
this.bot.sendMessage(punishmentObject.reason);
163161
}
164162
});
165-
166-
this.bannedPhrases.on('data', (obj) => {
167-
switch (obj.action) {
168-
case 'add':
169-
this.bot.sendAddPhrase(obj.phrase);
170-
break;
171-
case 'remove':
172-
this.bot.sendRemovePhrase(obj.phrase);
173-
break;
174-
default:
175-
break;
176-
}
177-
})
178163
}
179164
}
180165

lib/services/banned-phrase-emitter.js

-17
This file was deleted.

lib/services/destinychat.js

-10
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ const {
1212
formatUnmute,
1313
formatBan,
1414
formatUnban,
15-
formatAddPhrase,
16-
formatRemovePhrase,
1715
formatPoll,
1816
} = require('../chat-utils/parse-commands-from-chat');
1917

@@ -121,14 +119,6 @@ class DestinyChat extends EventEmitter {
121119
});
122120
}
123121

124-
sendAddPhrase(phrase) {
125-
this.ws.send(formatAddPhrase(phrase));
126-
}
127-
128-
sendRemovePhrase(phrase) {
129-
this.ws.send(formatRemovePhrase(phrase));
130-
}
131-
132122
handleError(event) {
133123
this.emit('error', event);
134124
}

lib/services/service-index.js

-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const RedditVote = require('./reddit-vote');
1919
const MessageRelay = require('./message-relay');
2020
const messageMatchingService = require('./message-matching');
2121
const HTMLMetadata = require('./html-metadata');
22-
const BannedPhrases = require('./banned-phrase-emitter')
2322

2423
class Services {
2524
constructor(serviceConfigurations, chatConnectedTo) {
@@ -50,7 +49,6 @@ class Services {
5049
if (chatConnectedTo === 'dgg') {
5150
this.redditVote = new RedditVote(serviceConfigurations.redditVote, this.logger);
5251
}
53-
this.bannedPhrases = new BannedPhrases();
5452
}
5553

5654
prepareAsyncServices() {

0 commit comments

Comments
 (0)