diff options
Diffstat (limited to 'src/listeners')
-rw-r--r-- | src/listeners/message/quoteCreate.ts | 23 | ||||
-rw-r--r-- | src/listeners/message/quoteEdit.ts | 17 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/listeners/message/quoteCreate.ts b/src/listeners/message/quoteCreate.ts new file mode 100644 index 0000000..08fd0cf --- /dev/null +++ b/src/listeners/message/quoteCreate.ts @@ -0,0 +1,23 @@ +import { BushListener, type BushClientEvents } from '#lib'; + +export default class QuoteCreateListener extends BushListener { + public constructor() { + super('quoteCreate', { + emitter: 'client', + event: 'messageCreate', + category: 'message' + }); + } + + public override async exec(...[message]: BushClientEvents['messageCreate']) { + if (message.author.id !== '322862723090219008') return; + if (!message.inGuild()) return; + + const messages = await util.resolveMessagesFromLinks(message.content); + if (!messages.length) return; + + for (const msg of messages) { + await message.guild.quote(msg, message.channel); + } + } +} diff --git a/src/listeners/message/quoteEdit.ts b/src/listeners/message/quoteEdit.ts new file mode 100644 index 0000000..790f05a --- /dev/null +++ b/src/listeners/message/quoteEdit.ts @@ -0,0 +1,17 @@ +// import { BushListener, type BushClientEvents } from '#lib'; + +// export default class QuoteEditListener extends BushListener { +// public constructor() { +// super('quoteEdit', { +// emitter: 'client', +// event: 'messageUpdate', +// category: 'message' +// }); +// } + +// public override async exec(...[_, newMessage]: BushClientEvents['messageUpdate']) { +// return; +// // if (newMessage.partial) newMessage = await newMessage.fetch(); +// // return new QuoteCreateListener().exec(newMessage); +// } +// } |