We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b8f30f1 commit 03bc9d2Copy full SHA for 03bc9d2
src/cool-links-management.ts
@@ -12,9 +12,16 @@ export const coolLinksManagement = async (message: Message) => {
12
13
await message.react('✅');
14
await message.react('❌');
15
- const { result, error } = await ogs({ url: detectedURLs[0] });
16
- const threadName = error ? message.content : `${result.ogSiteName} - ${result.ogTitle}`;
17
- await message.startThread({
18
- name: threadName,
19
- });
+ try {
+ const { result } = await ogs({ url: detectedURLs[0] });
+ const threadName = result.success
+ ? `${result.ogSiteName} - ${result.ogTitle}`
+ : message.content;
20
+ await message.startThread({
21
+ name: threadName,
22
+ autoArchiveDuration: 4320,
23
+ });
24
+ } catch (error) {
25
+ console.error(error);
26
+ }
27
};
0 commit comments