Check for message proxied through PluralKit
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
parent
557d5fc60f
commit
f340137996
2 changed files with 13 additions and 0 deletions
10
src/utils/pluralKit.ts
Normal file
10
src/utils/pluralKit.ts
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { Message } from "discord.js";
|
||||
|
||||
export async function proxied(message: Message): Promise<boolean> {
|
||||
if (message.webhookId !== null)
|
||||
return false;
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 300));
|
||||
const response = await fetch(`https://api.pluralkit.me/v2/messages/${message.id}`);
|
||||
return response.ok;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue