message recipient bugfix
This commit is contained in:
parent
c7ccad3974
commit
053818231a
6
index.js
6
index.js
@ -1,6 +1,6 @@
|
||||
// Global logging toggles
|
||||
// const fileLogging = false;
|
||||
const consoleLogging = false;
|
||||
const consoleLogging = true;
|
||||
|
||||
|
||||
// Imports
|
||||
@ -87,7 +87,7 @@ app.post('/nickname', (req, res) => {
|
||||
for (const u of users)
|
||||
if (u.name === oldName && u.id === id) {
|
||||
if (consoleLogging)
|
||||
console.log(`(Re-)named user with ID '${oldName}#${id}'.`);
|
||||
console.log(`Renamed user with ID '${oldName}#${id}'.`);
|
||||
u.name = name;
|
||||
u.id = currentID;
|
||||
break;
|
||||
@ -140,7 +140,7 @@ app.post('/message', (req, res) => {
|
||||
|
||||
// Log message for debugging
|
||||
if (consoleLogging)
|
||||
console.log(`User '${name}#${id}' sent message '${message}'.`);
|
||||
console.log(`User '${name}#${id}' sent message '${message}' to '${recipient}'.`);
|
||||
|
||||
// Confirm process
|
||||
res.status(200).send();
|
||||
|
Loading…
Reference in New Issue
Block a user