diff --git a/assets/icon.png b/assets/icon.png deleted file mode 100644 index 6211aef..0000000 Binary files a/assets/icon.png and /dev/null differ diff --git a/assets/sunset.png b/assets/sunset.png deleted file mode 100644 index 3a47468..0000000 Binary files a/assets/sunset.png and /dev/null differ diff --git a/index.tsx b/index.tsx index ec9269b..92d383f 100644 --- a/index.tsx +++ b/index.tsx @@ -6,14 +6,25 @@ dm @neoarz if u need help or have any questions https://github.com/neoarz/NitroSniper */ +import { definePluginSettings } from "@api/Settings"; import { Devs } from "@utils/constants"; import { Logger } from "@utils/Logger"; -import definePlugin from "@utils/types"; +import definePlugin, { OptionType } from "@utils/types"; import { findByPropsLazy } from "@webpack"; +import { UserStore } from "@webpack/common"; const logger = new Logger("NitroSniper"); const GiftActions = findByPropsLazy("redeemGiftCode"); +const settings = definePluginSettings({ + ignoreOwnGiftLinks: { + type: OptionType.BOOLEAN, + description: "Do not redeem Nitro gift links from messages sent by you.", + default: false, + restartNeeded: false + } +}); + let startTime = 0; let claiming = false; const codeQueue: string[] = []; @@ -51,6 +62,7 @@ export default definePlugin({ authors: [Devs.neoarz], tags: ["Chat", "Utility"], searchTerms: ["nitro", "gift", "redeem", "snipe"], + settings, start() { resetState(); @@ -59,6 +71,7 @@ export default definePlugin({ flux: { MESSAGE_CREATE({ message }) { if (!message.content) return; + if (settings.store.ignoreOwnGiftLinks && message.author?.id === UserStore.getCurrentUser()?.id) return; const match = message.content.match(/(?:discord\.gift\/|discord\.com\/gifts?\/)([a-zA-Z0-9]{16,24})/); if (!match) return;