@@ -32,7 +32,7 @@ export default async function forumWebhook(req: express.Request<{}, {}, any>, re
32
32
. setURL ( url )
33
33
. setDescription ( `**${ title } **\n\n${ htmlToText ( topic . firstPost . content ) . substring ( 0 , 2000 ) } ` )
34
34
. setTimestamp ( new Date ( topic . firstPost . date ) )
35
- . setImage ( SUGGESTION_ICON )
35
+ . setThumbnail ( SUGGESTION_ICON )
36
36
. setFooter ( { text : `Tags: ${ topic . tags . join ( ', ' ) } ` } ) ;
37
37
38
38
const webhookMessage : RESTPostAPIWebhookWithTokenJSONBody = { embeds : [ embed . data ] } ;
@@ -56,14 +56,11 @@ export default async function forumWebhook(req: express.Request<{}, {}, any>, re
56
56
const author = post . author . name ;
57
57
logger . info ( 'New post via forum webhook' , { threadId, url, author, content : htmlToText ( post . content ) } ) ;
58
58
// We need to get the thread info to make sure it's in the suggestion forum.
59
- const topic = await getTopic ( threadId ) . catch ( ( ) => {
60
- logger . warn ( 'Could not get topic for post' , { threadId, url, author } ) ;
59
+ const topic = await getTopic ( threadId ) . catch ( ( err ) => {
60
+ logger . warn ( 'Could not get topic for post' , { threadId, url, err } ) ;
61
61
return null ;
62
62
} ) ;
63
- if ( ! topic ) {
64
- logger . warn ( 'Could not get topic for post' , { threadId, url, author } ) ;
65
- return ;
66
- }
63
+ if ( ! topic ) return ;
67
64
// If this post is the first post in a thread we can ignore it.
68
65
if ( topic . firstPost . id === post . id ) return ;
69
66
// Only process posts in the suggestion forum.
@@ -73,7 +70,7 @@ export default async function forumWebhook(req: express.Request<{}, {}, any>, re
73
70
. setColor ( 'Orange' )
74
71
. setAuthor ( { name : author , iconURL : post . author . photoUrl } )
75
72
. setURL ( url )
76
- . setImage ( SUGGESTION_ICON )
73
+ . setThumbnail ( SUGGESTION_ICON )
77
74
. setDescription ( `${ htmlToText ( post . content ) . substring ( 0 , 2000 ) } ` )
78
75
. setTimestamp ( new Date ( post . date ) )
79
76
. setFooter ( { text : `Tags: ${ topic . tags . join ( ', ' ) } ` , iconURL : SUGGESTION_ICON } ) ;
0 commit comments