init
This commit is contained in:
commit
b2aca9110e
1 changed files with 33 additions and 0 deletions
33
index.ts
Normal file
33
index.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { definePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import { sendMessage } from "@utils/discord";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { UserStore } from "@webpack/common";
|
||||
|
||||
const ALLOWED_CHANNEL_IDs = ["1026504914131759104"];
|
||||
|
||||
const settings = definePluginSettings({
|
||||
allowedChannels: {
|
||||
type: OptionType.STRING,
|
||||
description: "comma separated list",
|
||||
default: ALLOWED_CHANNEL_IDs.join(",")
|
||||
}
|
||||
});
|
||||
|
||||
export default definePlugin({
|
||||
name: "WhoSaidKorn",
|
||||
description: "Who said KoRn?",
|
||||
authors: [Devs.nin0dev],
|
||||
settings,
|
||||
flux: {
|
||||
MESSAGE_CREATE(e) {
|
||||
if (!settings.store.allowedChannels.replaceAll(" ", "").split(",").includes(e.channelId)) return;
|
||||
if (e.message.author.id === UserStore.getCurrentUser().id) return;
|
||||
if (["corn", "korn"].every(korn => !e.message.content.includes(korn))) return;
|
||||
|
||||
sendMessage(e.channelId, {
|
||||
content: "who said korn"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue