aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSin-MacBook <[email protected]>2020-08-12 10:21:18 +0200
committerSin-MacBook <[email protected]>2020-08-12 10:21:18 +0200
commit7a133a9f72eede41d95eac171289a315c1ef41f6 (patch)
tree03b6d6aa43281d498e4dae31906abf4a86ddb100
parentok (diff)
downloadmodmail-7a133a9f72eede41d95eac171289a315c1ef41f6.tar.xz
modmail-7a133a9f72eede41d95eac171289a315c1ef41f6.zip
fix: fix formatting errors and neatness
-rw-r--r--src/modules/alert.js2
-rw-r--r--src/modules/block.js18
-rw-r--r--src/modules/close.js10
-rw-r--r--src/modules/logs.js2
-rw-r--r--src/modules/move.js8
-rw-r--r--src/modules/newthread.js6
-rw-r--r--src/modules/reply.js2
-rw-r--r--src/modules/suspend.js16
-rw-r--r--src/modules/version.js2
9 files changed, 33 insertions, 33 deletions
diff --git a/src/modules/alert.js b/src/modules/alert.js
index a844230..7ac923a 100644
--- a/src/modules/alert.js
+++ b/src/modules/alert.js
@@ -5,7 +5,7 @@ module.exports = ({ bot, knex, config, commands }) => {
await thread.postSystemMessage(`Cancelled new message alert`);
} else {
await thread.setAlert(msg.author.id);
- await thread.postSystemMessage(`Pinging ${msg.author.username}#${msg.author.discriminator} when this thread gets a new reply`);
+ await thread.postSystemMessage(`Pinging ${msg.author.username}#${msg.author.discriminator} when this thread gets a new reply.`);
}
});
};
diff --git a/src/modules/block.js b/src/modules/block.js
index 94913c4..46bb96a 100644
--- a/src/modules/block.js
+++ b/src/modules/block.js
@@ -31,7 +31,7 @@ module.exports = ({ bot, knex, config, commands }) => {
const isBlocked = await blocked.isBlocked(userIdToBlock);
if (isBlocked) {
- msg.channel.createMessage('User is already blocked');
+ msg.channel.createMessage('User is already blocked.');
return;
}
@@ -44,9 +44,9 @@ module.exports = ({ bot, knex, config, commands }) => {
if (expiresAt) {
const humanized = humanizeDuration(args.blockTime, { largest: 2, round: true });
- msg.channel.createMessage(`Blocked <@${userIdToBlock}> (id \`${userIdToBlock}\`) from modmail for ${humanized}`);
+ msg.channel.createMessage(`Blocked <@${userIdToBlock}> (id \`${userIdToBlock}\`) from modmail for ${humanized}.`);
} else {
- msg.channel.createMessage(`Blocked <@${userIdToBlock}> (id \`${userIdToBlock}\`) from modmail indefinitely`);
+ msg.channel.createMessage(`Blocked <@${userIdToBlock}> (id \`${userIdToBlock}\`) from modmail indefinitely.`);
}
};
@@ -59,7 +59,7 @@ module.exports = ({ bot, knex, config, commands }) => {
const isBlocked = await blocked.isBlocked(userIdToUnblock);
if (! isBlocked) {
- msg.channel.createMessage('User is not blocked');
+ msg.channel.createMessage('User is not blocked.');
return;
}
@@ -71,10 +71,10 @@ module.exports = ({ bot, knex, config, commands }) => {
if (unblockAt) {
const humanized = humanizeDuration(args.unblockDelay, { largest: 2, round: true });
await blocked.updateExpiryTime(userIdToUnblock, unblockAt);
- msg.channel.createMessage(`Scheduled <@${userIdToUnblock}> (id \`${userIdToUnblock}\`) to be unblocked in ${humanized}`);
+ msg.channel.createMessage(`Scheduled <@${userIdToUnblock}> (id \`${userIdToUnblock}\`) to be unblocked in ${humanized}.`);
} else {
await blocked.unblock(userIdToUnblock);
- msg.channel.createMessage(`Unblocked <@${userIdToUnblock}> (id ${userIdToUnblock}) from modmail`);
+ msg.channel.createMessage(`Unblocked <@${userIdToUnblock}> (id ${userIdToUnblock}) from modmail.`);
}
};
@@ -88,12 +88,12 @@ module.exports = ({ bot, knex, config, commands }) => {
const blockStatus = await blocked.getBlockStatus(userIdToCheck);
if (blockStatus.isBlocked) {
if (blockStatus.expiresAt) {
- msg.channel.createMessage(`<@!${userIdToCheck}> (id \`${userIdToCheck}\`) is blocked until ${blockStatus.expiresAt} (UTC)`);
+ msg.channel.createMessage(`<@!${userIdToCheck}> (id \`${userIdToCheck}\`) is blocked until ${blockStatus.expiresAt} (UTC).`);
} else {
- msg.channel.createMessage(`<@!${userIdToCheck}> (id \`${userIdToCheck}\`) is blocked indefinitely`);
+ msg.channel.createMessage(`<@!${userIdToCheck}> (id \`${userIdToCheck}\`) is blocked indefinitely.`);
}
} else {
- msg.channel.createMessage(`<@!${userIdToCheck}> (id \`${userIdToCheck}\`) is NOT blocked`);
+ msg.channel.createMessage(`<@!${userIdToCheck}> (id \`${userIdToCheck}\`) is NOT blocked.`);
}
});
};
diff --git a/src/modules/close.js b/src/modules/close.js
index b3e7421..99889a9 100644
--- a/src/modules/close.js
+++ b/src/modules/close.js
@@ -20,8 +20,8 @@ module.exports = ({ bot, knex, config, commands }) => {
const logUrl = await thread.getLogUrl();
utils.postLog(utils.trimAll(`
- Modmail thread with ${thread.user_name} (${thread.user_id}) was closed as scheduled by ${thread.scheduled_close_name}
- Logs: ${logUrl}
+ Modmail thread with ${thread.user_name} (${thread.user_id}) was closed as scheduled by ${thread.scheduled_close_name}.
+ Logs: ${logUrl}.
`));
}
}
@@ -74,7 +74,7 @@ module.exports = ({ bot, knex, config, commands }) => {
// Cancel timed close
if (thread.scheduled_close_at) {
await thread.cancelScheduledClose();
- thread.postSystemMessage(`Cancelled scheduled closing`);
+ thread.postSystemMessage(`Cancelled scheduled closing.`);
}
return;
@@ -123,7 +123,7 @@ module.exports = ({ bot, knex, config, commands }) => {
const logUrl = await thread.getLogUrl();
utils.postLog(utils.trimAll(`
- Modmail thread with ${thread.user_name} (${thread.user_id}) was closed by ${closedBy}
+ Modmail thread with ${thread.user_name} (${thread.user_id}) was closed by ${closedBy}.
Logs: ${logUrl}
`));
});
@@ -146,7 +146,7 @@ module.exports = ({ bot, knex, config, commands }) => {
const logUrl = await thread.getLogUrl();
utils.postLog(utils.trimAll(`
- Modmail thread with ${thread.user_name} (${thread.user_id}) was closed automatically because the channel was deleted
+ Modmail thread with ${thread.user_name} (${thread.user_id}) was closed automatically because the channel was deleted.
Logs: ${logUrl}
`));
});
diff --git a/src/modules/logs.js b/src/modules/logs.js
index 0664c07..0ce9f24 100644
--- a/src/modules/logs.js
+++ b/src/modules/logs.js
@@ -41,7 +41,7 @@ module.exports = ({ bot, knex, config, commands }) => {
message += `\n${threadLines.join('\n')}`;
if (isPaginated) {
- message += `\nTo view more, add a page number to the end of the command`;
+ message += `\nTo view more, add a page number to the end of the command.`;
}
// Send the list of logs in chunks of 15 lines per message
diff --git a/src/modules/move.js b/src/modules/move.js
index 973143d..cdfb781 100644
--- a/src/modules/move.js
+++ b/src/modules/move.js
@@ -41,7 +41,7 @@ module.exports = ({ bot, knex, config, commands }) => {
});
if (containsRankings[0][1] === 0) {
- thread.postSystemMessage('No matching category');
+ thread.postSystemMessage('No matching category'.``);
return;
}
@@ -52,7 +52,7 @@ module.exports = ({ bot, knex, config, commands }) => {
parentID: targetCategory.id
});
} catch (e) {
- thread.postSystemMessage(`Failed to move thread: ${e.message}`);
+ thread.postSystemMessage(`Failed to move thread: ${e.message}.`);
return;
}
@@ -72,11 +72,11 @@ module.exports = ({ bot, knex, config, commands }) => {
permission_overwrites: newPerms
});
} catch (e) {
- thread.postSystemMessage(`Thread moved to ${targetCategory.name.toUpperCase()}, but failed to sync permissions: ${e.message}`);
+ thread.postSystemMessage(`Thread moved to ${targetCategory.name.toUpperCase()}, but failed to sync permissions: ${e.message}.`);
return;
}
}
- thread.postSystemMessage(`Thread moved to ${targetCategory.name.toUpperCase()}`);
+ thread.postSystemMessage(`Thread moved to ${targetCategory.name.toUpperCase()}.`);
});
};
diff --git a/src/modules/newthread.js b/src/modules/newthread.js
index aca6f54..0b69741 100644
--- a/src/modules/newthread.js
+++ b/src/modules/newthread.js
@@ -11,13 +11,13 @@ module.exports = ({ bot, knex, config, commands }) => {
const existingThread = await threads.findOpenThreadByUserId(user.id);
if (existingThread) {
- utils.postSystemMessageWithFallback(msg.channel, thread, `Cannot create a new thread; there is another open thread with this user: <#${existingThread.channel_id}>`);
+ utils.postSystemMessageWithFallback(msg.channel, thread, `Cannot create a new thread; there is another open thread with this user: <#${existingThread.channel_id}>.`);
return;
}
const createdThread = await threads.createNewThreadForUser(user, true, true);
- createdThread.postSystemMessage(`Thread was opened by ${msg.author.username}#${msg.author.discriminator}`);
+ createdThread.postSystemMessage(`Thread was opened by ${msg.author.username}#${msg.author.discriminator}.`);
- msg.channel.createMessage(`Thread opened: <#${createdThread.channel_id}>`);
+ msg.channel.createMessage(`Thread opened: <#${createdThread.channel_id}>.`);
});
};
diff --git a/src/modules/reply.js b/src/modules/reply.js
index bc2afe3..313c08a 100644
--- a/src/modules/reply.js
+++ b/src/modules/reply.js
@@ -20,7 +20,7 @@ module.exports = ({ bot, knex, config, commands }) => {
// Anonymous replies only show the role, not the username
commands.addInboxThreadCommand('anonreply', '[text$]', async (msg, args, thread) => {
if (! args.text && msg.attachments.length === 0) {
- utils.postError(msg.channel, 'Text or attachment required');
+ utils.postError(msg.channel, 'Text or attachment required.');
return;
}
diff --git a/src/modules/suspend.js b/src/modules/suspend.js
index 7edd096..87dba68 100644
--- a/src/modules/suspend.js
+++ b/src/modules/suspend.js
@@ -12,7 +12,7 @@ module.exports = ({ bot, knex, config, commands }) => {
for (const thread of threadsToBeSuspended) {
if (thread.status === THREAD_STATUS.OPEN) {
await thread.suspend();
- await thread.postSystemMessage(`**Thread suspended** as scheduled by ${thread.scheduled_suspend_name}. This thread will act as closed until unsuspended with \`!unsuspend\``);
+ await thread.postSystemMessage(`**Thread suspended** as scheduled by ${thread.scheduled_suspend_name}. This thread will act as closed until unsuspended with \`!unsuspend\`.`);
}
}
}
@@ -33,9 +33,9 @@ module.exports = ({ bot, knex, config, commands }) => {
// Cancel timed suspend
if (thread.scheduled_suspend_at) {
await thread.cancelScheduledSuspend();
- thread.postSystemMessage(`Cancelled scheduled suspension`);
+ thread.postSystemMessage(`Cancelled scheduled suspension.`);
} else {
- thread.postSystemMessage(`Thread is not scheduled to be suspended`);
+ thread.postSystemMessage(`Thread is not scheduled to be suspended.`);
}
});
@@ -50,28 +50,28 @@ module.exports = ({ bot, knex, config, commands }) => {
}
await thread.suspend();
- thread.postSystemMessage(`**Thread suspended!** This thread will act as closed until unsuspended with \`!unsuspend\``);
+ thread.postSystemMessage(`**Thread suspended!** This thread will act as closed until unsuspended with \`!unsuspend\`.`);
});
commands.addInboxServerCommand('unsuspend', [], async (msg, args, thread) => {
if (thread) {
- thread.postSystemMessage(`Thread is not suspended`);
+ thread.postSystemMessage(`Thread is not suspended.`);
return;
}
thread = await threads.findSuspendedThreadByChannelId(msg.channel.id);
if (! thread) {
- thread.postSystemMessage(`Not in a thread`);
+ thread.postSystemMessage(`Not in a thread.`);
return;
}
const otherOpenThread = await threads.findOpenThreadByUserId(thread.user_id);
if (otherOpenThread) {
- thread.postSystemMessage(`Cannot unsuspend; there is another open thread with this user: <#${otherOpenThread.channel_id}>`);
+ thread.postSystemMessage(`Cannot unsuspend; there is another open thread with this user: <#${otherOpenThread.channel_id}>.`);
return;
}
await thread.unsuspend();
- thread.postSystemMessage(`**Thread unsuspended!**`);
+ thread.postSystemMessage(`**Thread unsuspended!**.`);
});
};
diff --git a/src/modules/version.js b/src/modules/version.js
index fc15d9b..1192e80 100644
--- a/src/modules/version.js
+++ b/src/modules/version.js
@@ -15,7 +15,7 @@ module.exports = ({ bot, knex, config, commands }) => {
const packageJson = require('../../package.json');
const packageVersion = packageJson.version;
- let response = `Modmail v${packageVersion}`;
+ let response = `Modmail v${packageVersion}.`;
/* let isGit;
try {