commit
2e55ea8b54
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "Lighty Simulator",
|
||||
"description": "Annoys message logger users",
|
||||
"version": "1.0.0",
|
||||
"authors": ["373833473091436546"],
|
||||
"tags": [
|
||||
"messages"
|
||||
],
|
||||
"main": "index.js"
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
import Plugin from '@goosemod/plugin';
|
||||
|
||||
|
||||
|
||||
class LightySimulator extends Plugin {
|
||||
onImport() {
|
||||
const queue = goosemod.webpackModules.findByProps("enqueue");
|
||||
const {getChannelId} = goosemod.webpackModules.findByProps("getChannelId", "getLastSelectedChannelId");
|
||||
const {editMessage} = goosemod.webpackModules.findByProps("sendMessage", "editMessage");
|
||||
this.command('edit', 'Annoy message logger users', ({ text: [ { text } ] }) => {
|
||||
const channel = getChannelId();
|
||||
const msg = text.split('');
|
||||
let current = msg[0];
|
||||
let yes = '';
|
||||
queue.enqueue({ message: { content: current,
|
||||
channelId: channel },
|
||||
type: 0
|
||||
}, m => {
|
||||
msg.shift();
|
||||
msg.forEach((e, i) => {
|
||||
setTimeout(() => {
|
||||
if (e === ' ') {
|
||||
yes = ' ';
|
||||
return;
|
||||
}
|
||||
editMessage(m.body.channel_id, m.body.id, { content: current + yes + e,
|
||||
channelId: channel });
|
||||
current = current + yes + e;
|
||||
yes = '';
|
||||
}, 1000 * i);
|
||||
});
|
||||
}
|
||||
);
|
||||
}, [ { type: 3, required: true, name: 'text', description: 'Text' } ]);
|
||||
}
|
||||
|
||||
onRemove() {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
export default new LightySimulator();
|
Loading…
Reference in new issue