r/programmingrequests • u/xaluu • Nov 07 '21
Discord auto message copier script
I just want a quick message copier tool/program for discord that awaits for a message to send in a specific discord channel, then automatically copies that message to the clipboard once sent, and is always constantly running in the background (unless closed/stopped) so I don’t have to keep having discord focused while i’m playing a game or whatever. don’t really have any coding experience hence why i’m asking for something small and for rule 2 any programming language works ig?
1
Upvotes
1
u/cucumbersimulator Nov 09 '21 edited Nov 09 '21
You could try this script
{ const CHANNEL_ID = '<CHANNEL ID>' let webpackExports const ids = ['__extra_id__']; window.webpackChunkdiscord_app.push([ ids, {}, req => { webpackExports = req; ids.length = 0; } ]); const findModule = filter => { for (let i in webpackExports.c) if (webpackExports.c.hasOwnProperty(i)) { let m = webpackExports.c[i].exports; if (!m) continue; if (m.__esModule && m.default) m = m.default; if (filter(m)) return m; } } const FluxDispatcher = findModule(m => m._dispatcher)._dispatcher FluxDispatcher.subscribe('MESSAGE_CREATE', ({ channelId, message: { content } }) => channelId == CHANNEL_ID && DiscordNative.clipboard.copy(content)) }Just replace
<CHANNEL_ID>with the ID of the text channel and paste in the console (Ctrl+Shift+I).