Compare commits

...
2 Commits
4 changed files with 17 additions and 15 deletions
+1
View File
@@ -5,4 +5,5 @@ config/*
!ecosystem.config.js
*.sqlite
points/*
points-*
assets/mash-words.json
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "schat2-clive",
"version": "1.30.9",
"version": "1.30.10",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "schat2-clive",
"version": "1.30.9",
"version": "1.30.10",
"license": "ISC",
"dependencies": {
"better-sqlite3": "^8.3.0",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "schat2-clive",
"version": "1.30.9",
"version": "1.30.10",
"description": "Game host for SChat 2-powered chat sites",
"main": "src/app.js",
"scripts": {
+13 -12
View File
@@ -32,6 +32,19 @@ async function init() {
const games = await getGames(bot, config.user.id);
// registered fires again on every reconnect, so these must only be bound once
client.addListener('message', (from, to, body) => onMessage({
from,
to,
recipient: /^#/.test(to) ? null : to,
body,
type: 'message',
}, bot, games));
client.addListener('error', (error) => {
logger.error(error);
});
client.addListener('registered', () => {
logger.info('Connected!');
logger.info('Identifying with NickServ');
@@ -47,18 +60,6 @@ async function init() {
client.say(channel, config.greeting);
}
});
client.addListener('message', (from, to, body) => onMessage({
from,
to,
recipient: /^#/.test(to) ? null : to,
body,
type: 'message',
}, bot, games));
client.addListener('error', (error) => {
logger.error(error);
});
});
}