fix me being silly with messagetags

This commit is contained in:
Elvyra 2025-01-13 04:10:07 +01:00
parent 567127ff45
commit 6166a8ef17

View file

@ -64,17 +64,16 @@ function createTagCommand(tag: Tag) {
const settings = definePluginSettings({ const settings = definePluginSettings({
clyde: {
description: "If enabled, clyde will send you an ephemeral message when a tag was used.",
type: OptionType.BOOLEAN,
default: true
},
data: { data: {
type: OptionType.ARRAY, type: OptionType.ARRAY,
hidden: true, hidden: true,
description: "" description: ""
}, },
migrated: {
type: OptionType.BOOLEAN,
description: "",
default: false,
hidden: true
}
}); });
@ -82,22 +81,16 @@ export default definePlugin({
name: "MessageTags", name: "MessageTags",
description: "Allows you to save messages and to use them with a simple command.", description: "Allows you to save messages and to use them with a simple command.",
authors: [Devs.Luna], authors: [Devs.Luna],
options: {
clyde: {
name: "Clyde message on send",
description: "If enabled, clyde will send you an ephemeral message when a tag was used.",
type: OptionType.BOOLEAN,
default: true
}
},
settings, settings,
async start() { async start() {
if (!settings.store.migrated) {
const data = await DataStore.get(DATA_KEY); const data = await DataStore.get(DATA_KEY);
if (data !== undefined) settings.store.data = data;
settings.store.migrated = true; if (data != null) {
settings.store.data = data;
await DataStore.del(DATA_KEY);
} }
for (const tag of settings.store.data) createTagCommand(tag); for (const tag of settings.store.data) createTagCommand(tag);
}, },