remove old code comment
This commit is contained in:
parent
161083c58f
commit
93e2af096d
49
src/index.ts
49
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<string> {
|
||||
// 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);
|
||||
// }
|
||||
// }
|
Loading…
Reference in New Issue
Block a user