mirror of
https://github.com/SrIzan10/DiscordFreeEmojis.git
synced 2026-05-01 10:45:13 +00:00
Update DiscordFreeEmojis.plugin.js
This commit is contained in:
@@ -97,7 +97,7 @@ function Init()
|
||||
if(webpackUtil == null) { Utils.Error("Webpack not found."); return 0; }
|
||||
const { findModule, 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' ]);
|
||||
@@ -106,8 +106,8 @@ function Init()
|
||||
let emojiPickerModule = findModuleByUniqueProperties([ 'useEmojiSelectHandler' ]);
|
||||
if(emojiPickerModule == null) { Utils.Error("emojiPickerModule not found."); return 0; }
|
||||
|
||||
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); };
|
||||
@@ -127,7 +127,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 = [];
|
||||
return result;
|
||||
@@ -178,7 +178,7 @@ function Start() {
|
||||
function Stop() {
|
||||
if(!Initialized) return;
|
||||
|
||||
searchHook = Discord.original_search;
|
||||
searchHook = Discord.original_searchWithoutFetchingLatest;
|
||||
parseHook = Discord.original_parse;
|
||||
useEmojiSelectHandlerHook = Discord.original_useEmojiSelectHandler;
|
||||
}
|
||||
@@ -187,7 +187,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!",
|
||||
getVersion: () => "1.5",
|
||||
getVersion: () => "1.6",
|
||||
getAuthor: () => "An0",
|
||||
|
||||
start: Start,
|
||||
|
||||
Reference in New Issue
Block a user