From 93e2af096d6929e08bc5948cb04a97ad705b36be Mon Sep 17 00:00:00 2001 From: Hare Date: Sun, 20 Oct 2024 03:45:32 +0900 Subject: [PATCH] remove old code comment --- src/index.ts | 51 +-------------------------------------------------- 1 file changed, 1 insertion(+), 50 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2c00684..d09b293 100644 --- a/src/index.ts +++ b/src/index.ts @@ -69,7 +69,6 @@ client.on("interactionCreate", async (interaction) => { entry = new Entry(interaction.guildId!); entries.push(entry); } - // entry.output_hook = (await registWebhook(channel as TextChannel)); entry.output_channel = channel.id; writeConfig(entries); } catch (error) { @@ -218,57 +217,9 @@ client.on(Events.MessageReactionAdd, async (reaction, user) => { channel.send({ embeds: [awardEmbed(reaction)] }); - // sendWebhookMessage(entry.output_hook, { - // username: `${reaction.message.author?.displayName}`, - // avatarURL: reaction.message.author?.avatarURL() || "", - // content: reaction.message.content?.replace(/<@!?(\d+)>/g, (match) => { - // const id = match.match(/\d+/)?.[0]; - // if (!id) return match; - // const member = reaction.message.guild?.members.cache.get(id); - // return `**@ ${member?.displayName}**` || match; - // }) || "", - // files: attachments.map((attachment) => attachment.url), - // embeds: [awardEmbed(reaction)], - // }); } else if (reaction.count > entry.count) { } }); -client.login(TOKEN); - -// async function registWebhook(channel: TextChannel): Promise { -// const existing = entries.find((entry) => entry.server === channel.guildId)?.output_hook; -// if (existing) { -// try { -// const webhook = new WebhookClient({ url: existing }); -// webhook.edit({ -// name: 'Reaction Award Bot', -// channel: channel.id, -// }); -// return webhook.url; -// } catch (error) { -// console.error("failed to edit existing webhook"); -// } -// } else { -// try { -// const webhook = await channel.createWebhook({ -// name: 'Reaction Award Bot', -// }) -// return webhook.url -// } catch (error) { -// console.error("failed to create webhook"); -// } -// } -// return ""; -// } - -// async function sendWebhookMessage(url: string, options: WebhookMessageCreateOptions) { -// try { -// const webhook = new WebhookClient({ url }); -// if (!webhook) return; -// await webhook.send(options); -// } catch (error) { -// console.error(error); -// } -// } \ No newline at end of file +client.login(TOKEN); \ No newline at end of file