Skip to content

Commit 09d5f3f

Browse files
authored
Merge pull request #42 from neilenns/neilenns/issue41
Link directly to thread in error messages instead of putting the name
2 parents bc5b561 + 7ec5026 commit 09d5f3f

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/events/threadUpdate.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ module.exports = {
5050
try {
5151
if (!newThread.manageable) {
5252
logger.error(
53-
`No permission to manage thread "${newThread.name}" in channel <#${newThread.parentId}>`,
53+
`No permission to manage thread <#${newThread.id}> in channel <#${newThread.parentId}>`,
5454
{
5555
thread: newThread.name,
56+
threadId: newThread.id,
5657
parent: newThread.parent.name,
5758
parentId: newThread.parentId,
5859
}
@@ -70,9 +71,10 @@ module.exports = {
7071
// This is debug instead of warn because it's quite common to have no tags, it means the bot was triggered by a thread
7172
// change in a channel that doesn't have the tags enabled on it.
7273
logger.debug(
73-
`Unable to lock thread "${newThread.name}": couldn't find tag name ${process.env.SOLVED_TAG_NAME} in channel <#${newThread.parentId}>.`,
74+
`Unable to lock thread <#${newThread.id}>: couldn't find tag name ${process.env.SOLVED_TAG_NAME} in channel <#${newThread.parentId}>.`,
7475
{
7576
thread: newThread.name,
77+
threadId: newThread.id,
7678
solvedTag: process.env.SOLVED_TAG_NAME,
7779
parent: newThread.parent.name,
7880
parentId: newThread.parentId,
@@ -91,9 +93,10 @@ module.exports = {
9193
newThread.createdTimestamp
9294
).toUTCString();
9395
logger.info(
94-
`Not sending closed message to "${newThread.name}" in channel <#${newThread.parentId}> since it was created ${createdDate} which is more than ${process.env.OLD_THREAD_AGE_IN_DAYS} days ago.`,
96+
`Not sending closed message to <#${newThread.id}> in channel <#${newThread.parentId}> since it was created ${createdDate} which is more than ${process.env.OLD_THREAD_AGE_IN_DAYS} days ago.`,
9597
{
9698
thread: newThread.name,
99+
threadId: newThread.id,
97100
parent: newThread.parent.name,
98101
parentId: newThread.parentId,
99102
createdDate,

0 commit comments

Comments
 (0)