mirror of
https://github.com/SrIzan10/DiscordFreeEmojis.git
synced 2026-05-01 10:45:13 +00:00
Fixed break due to discord internal change
This commit is contained in:
@@ -101,7 +101,7 @@ function Init()
|
||||
if(webpackUtil == null) { Utils.Error("Webpack not found."); return 0; }
|
||||
const { findModuleByUniqueProperties } = webpackUtil;
|
||||
|
||||
let emojisModule = findModuleByUniqueProperties([ 'getDisambiguatedEmojiContext', 'search' ]);
|
||||
let emojisModule = findModuleByUniqueProperties([ 'getDisambiguatedEmojiContext', 'searchWithoutFetchingLatest' ]);
|
||||
if(emojisModule == null) { Utils.Error("emojisModule not found."); return 0; }
|
||||
|
||||
let messageEmojiParserModule = findModuleByUniqueProperties([ 'parse', 'parsePreprocessor', 'unparse' ]);
|
||||
@@ -116,8 +116,8 @@ function Init()
|
||||
let messageQueueModule = findModuleByUniqueProperties( [ 'enqueue', 'handleSend', 'handleEdit' ]);
|
||||
if(messageQueueModule == null) Utils.Warn("messageQueueModule not found.");
|
||||
|
||||
searchHook = Discord.original_search = emojisModule.search;
|
||||
emojisModule.search = function() { return searchHook.apply(this, arguments); };
|
||||
searchHook = Discord.original_searchWithoutFetchingLatest = emojisModule.searchWithoutFetchingLatest;
|
||||
emojisModule.searchWithoutFetchingLatest = function() { return searchHook.apply(this, arguments); };
|
||||
|
||||
parseHook = Discord.original_parse = messageEmojiParserModule.parse;
|
||||
messageEmojiParserModule.parse = function() { return parseHook.apply(this, arguments); };
|
||||
@@ -144,7 +144,7 @@ function Start() {
|
||||
const { original_parse, original_useEmojiSelectHandler } = Discord;
|
||||
|
||||
searchHook = function() {
|
||||
let result = Discord.original_search.apply(this, arguments);
|
||||
let result = Discord.original_searchWithoutFetchingLatest.apply(this, arguments);
|
||||
|
||||
result.unlocked.push(...result.locked);
|
||||
result.locked = [];
|
||||
@@ -252,7 +252,7 @@ function Start() {
|
||||
function Stop() {
|
||||
if(!Initialized) return;
|
||||
|
||||
searchHook = Discord.original_search;
|
||||
searchHook = Discord.original_searchWithoutFetchingLatest;
|
||||
parseHook = Discord.original_parse;
|
||||
useEmojiSelectHandlerHook = Discord.original_useEmojiSelectHandler;
|
||||
if(enqueueHook) enqueueHook = Discord.original_enqueue;
|
||||
@@ -262,7 +262,7 @@ return function() { return {
|
||||
getName: () => "DiscordFreeEmojis",
|
||||
getShortName: () => "FreeEmojis",
|
||||
getDescription: () => "Link emojis if you don't have nitro! Type them out or use the emoji picker! [Split]",
|
||||
getVersion: () => "1.5",
|
||||
getVersion: () => "1.6",
|
||||
getAuthor: () => "An0",
|
||||
|
||||
start: Start,
|
||||
|
||||
Reference in New Issue
Block a user