forked from userplugins/sentFromMyUname
Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
80daa79d7e |
1 changed files with 4 additions and 10 deletions
8
index.ts
8
index.ts
|
@ -1,4 +1,3 @@
|
||||||
import { addPreSendListener, removePreSendListener } from "@api/MessageEvents";
|
|
||||||
import { definePluginSettings, Settings } from "@api/Settings";
|
import { definePluginSettings, Settings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType, PluginNative } from "@utils/types";
|
import definePlugin, { OptionType, PluginNative } from "@utils/types";
|
||||||
|
@ -39,14 +38,9 @@ export default definePlugin({
|
||||||
type: OptionType.STRING
|
type: OptionType.STRING
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
start() {
|
onBeforeMessageSend: async (c, msg) => {
|
||||||
this.preSend = addPreSendListener(async (c, msg) => {
|
|
||||||
if (Settings.plugins.SentFromMyUname.channelWhitelist && !Settings.plugins.SentFromMyUname.channelWhitelist.includes(c)) return;
|
if (Settings.plugins.SentFromMyUname.channelWhitelist && !Settings.plugins.SentFromMyUname.channelWhitelist.includes(c)) return;
|
||||||
if (msg.content.startsWith("nouname ")) { msg.content = msg.content.replace("nouname ", ""); return; }
|
if (msg.content.startsWith("nouname ")) { msg.content = msg.content.replace("nouname ", ""); return; }
|
||||||
msg.content += `\n\nSent from my ${await getWhateverShouldBeSentFromMy()}`;
|
msg.content += `\n\nSent from my ${await getWhateverShouldBeSentFromMy()}`;
|
||||||
});
|
|
||||||
},
|
|
||||||
stop() {
|
|
||||||
removePreSendListener(this.preSend);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue