Skip to content

Instantly share code, notes, and snippets.

@aiko-chan-ai
Last active March 30, 2024 03:02
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aiko-chan-ai/e3cf1ce0107e8e273653f55b0e36e2c8 to your computer and use it in GitHub Desktop.
Save aiko-chan-ai/e3cf1ce0107e8e273653f55b0e36e2c8 to your computer and use it in GitHub Desktop.
Discord Webpack

Get + Find modules

!function(){"use strict";function e(){let e=window.webpackChunkdiscord_app.push([[Symbol()],{},e=>e]);return window.webpackChunkdiscord_app.pop(),e}function t(){let t=[];for(let n of Object.values(e().c))n.exports&&n.exports!==window&&t.push(n.exports);return t}function n(e){return t().find(e)}function r(e){return t().filter(e)}function o(e,t=!1){var o=t?[]:null;let i=(t?r:n)(function(n){let r=e(n);return r&&(t?o.push(r):o=r),r});return t?o.map((e,t)=>"string"==typeof e?i[t][e]:i[t]):"string"==typeof o?i[o]:i}function i(e,t){if(e?.displayName===t||"function"==typeof e?.getName&&e.getName()===t)return!0;for(let n of Object.getOwnPropertyNames(e)){try{e[n]}catch{console.warn("%c[elysia] %cFailed to access property","color: purple","",n,e);continue}if(e[n]?.displayName===t||"function"==typeof e[n]?.getName&&e[n]?.getName()===t)return n}}function l(e,t){var n=null;for(let r of t){if(e&&["object","function"].includes(typeof e)&&r in e)continue;let o=null;for(let i of Object.getOwnPropertyNames(e)){if("default"!==i&&i.length>3)continue;let l=e[i];if(l&&["object","function"].includes(typeof l)&&r in l){o=i;break}}if(!o)return;n=o}return n||!0}function u(t,n=!1){if("string"==typeof t){let r=t;t={test:e=>!!e.includes&&e.includes(r)}}let{m:o,c:i}=e(),l=Object.entries(o).filter(([,e])=>t.test(e.toString()));if(!n)return i[l.find(([e])=>i[e]?.exports)?.[0]||null]?.exports;{let u=[];for(let[f]of l){let s=i[f]?.exports;s&&u.push(s)}return u}}window.webpack={get modules(){return t()},find:n,findAll:r,findByID:t=>e().c[t=parseInt(t)]?.exports,findByDisplayName:e=>o(t=>i(t,e)),findByDisplayNameAll:e=>o(t=>i(t,e),!0),findByProps:(...e)=>o(t=>l(t,e)),findByPropsAll:(...e)=>o(t=>l(t,e),!0),findByCode:e=>u(e),findByCodeAll:e=>u(e,!0),_getModule(e,t=!1){if(e.length>1)return this.findByProps(...e);if(e[0]instanceof RegExp)return u(e[0],t);if(Array.isArray(e[0]))return(t?this.findByPropsAll:this.findByProps)(...e[0]);{let f=e[0];switch(typeof f){case"function":return(t?r:n)(f);case"number":return this.findByID(f);default:return o(e=>i(e,f)||l(e,[f]),t)}}},getModule(...e){return this._getModule(e)},getModules(...e){return this._getModule(e,!0)}},console.log("%c[elysia] %cLoaded successfully!","color: purple","")}();

List of modules

getToken

webpack.getModule('getToken').getToken() // current
webpack.getModule('getToken').getToken('user id') // multi accounts

loginToken

webpack.getModule('loginToken').loginToken('ur token')

getSessionId

webpack.getModule("getSessionId").getSessionId()

getCurrentUser

webpack.getModule("getCurrentUser").getCurrentUser();

getGuilds

webpack.getModule("getGuild", "getGuilds").getGuilds()

getGuild

webpack.getModule("getGuild", "getGuilds").getGuild('guild id')

getLastSelectedGuildId

webpack.getModule("getLastSelectedGuildId").getGuildId()

getGuildFolders

webpack.getModule("getSortedGuilds").getSortedGuilds()

getPrivateChannels

webpack
    .getModule("getMutablePrivateChannels")
    .getSortedPrivateChannels();

getGuildChannels

webpack
    .getModule("getMutableGuildChannelsForGuild")
    .getMutableGuildChannelsForGuild('guild id')

getChannel

webpack.getModule("hasChannel").getChannel('channel id')

getChannelThreads

webpack
    .getModule("getAllThreadsForParent")
    .getAllThreadsForParent('channel id')

getLastSelectedChannelId

webpack
    .getModule("getLastSelectedChannelId")
    .getLastSelectedChannelId()

getGuildMember

webpack.getModule("getMember").getMember('guildID', 'user id')

getGuildMembers

webpack.getModule("getMembers").getMembers('guildID')

getMutableAllGuildsAndMembers

webpack.getModule('getMutableAllGuildsAndMembers').getMutableAllGuildsAndMembers()

getStatus

webpack.findByProps('getStatus', 'getActivities', 'getState').getStatus('user id')

murmurhash (v2 / v3)

// v3
webpack.findByProps('v3').v3('string')

sendClydeMessage

webpack
    .getModule("sendBotMessage")
    .sendBotMessage(channelId, content, embeds)

sendClydeError

webpack.getModule("sendBotMessage").sendClydeError(channelId)

showNotification

webpack
    .findByProps("showNotification")
    .showNotification(icon, title, body, null, {
        sound: 'message1',
        volume: 0.4,
    });

Discord Experiments (Staff mode)

usermod = webpack.findByProps('getUsers');
nodes = Object.values(
	webpack.findByProps('isDeveloper')._dispatcher._actionHandlers
		._dependencyGraph.nodes,
);
try {
	nodes
		.find((x) => x.name == 'ExperimentStore')
		.actionHandler['OVERLAY_INITIALIZE']({
			user: {
				flags: 1,
			},
		});
} catch (e) {}
oldGetUser = usermod.__proto__.getCurrentUser;
usermod.__proto__.getCurrentUser = () => ({
	isStaff: () => true,
});
nodes
	.find((x) => x.name == 'DeveloperExperimentStore')
	.actionHandler['CONNECTION_OPEN']();
usermod.__proto__.getCurrentUser = oldGetUser;

Fake Nitro (2k / 60fps stream)

webpack.findByProps('getUsers').getCurrentUser().premiumType = 2;
// 2: Nitro Boost
// 1: Nitro Classic
// 0: None

View NSFW Channel

webpack.findByProps('getUsers').getCurrentUser().nsfwAllowed = true;

Inject CSS [can't use import (cors)]

__SECRET_EMOTION__.injectGlobal(`
    * {
--background-primary: #000000;
    --background-secondary: #000000;
--background-secondary-alt: #070707ff;
--background-accent: #252525;
--background-floating: #242424ff;
    --scrollbar-thin-track: #000000;
    --channeltextarea-background: #151515;
    }
`)

update later

@BachLe2000
Copy link

read if cute

@LunarN0v4
Copy link

this is actually really useful, wow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment