Update ChatAliases.plugin.js
This commit is contained in:
parent
f83b37e1ea
commit
bc0ee3f271
|
@ -2,7 +2,7 @@
|
||||||
* @name ChatAliases
|
* @name ChatAliases
|
||||||
* @author DevilBro
|
* @author DevilBro
|
||||||
* @authorId 278543574059057154
|
* @authorId 278543574059057154
|
||||||
* @version 2.3.1
|
* @version 2.3.2
|
||||||
* @description Allows you to configure your own Aliases/Commands
|
* @description Allows you to configure your own Aliases/Commands
|
||||||
* @invite Jx3TjNS
|
* @invite Jx3TjNS
|
||||||
* @donate https://www.paypal.me/MircoWittrien
|
* @donate https://www.paypal.me/MircoWittrien
|
||||||
|
@ -17,7 +17,7 @@ module.exports = (_ => {
|
||||||
"info": {
|
"info": {
|
||||||
"name": "ChatAliases",
|
"name": "ChatAliases",
|
||||||
"author": "DevilBro",
|
"author": "DevilBro",
|
||||||
"version": "2.3.1",
|
"version": "2.3.2",
|
||||||
"description": "Allows you to configure your own Aliases/Commands"
|
"description": "Allows you to configure your own Aliases/Commands"
|
||||||
},
|
},
|
||||||
"changeLog": {
|
"changeLog": {
|
||||||
|
@ -131,15 +131,6 @@ module.exports = (_ => {
|
||||||
if (BDFDB.LibraryModules.AutocompleteOptions && BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS) {
|
if (BDFDB.LibraryModules.AutocompleteOptions && BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS) {
|
||||||
BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS[AUTOCOMPLETE_ALIAS_OPTION] = {
|
BDFDB.LibraryModules.AutocompleteOptions.AUTOCOMPLETE_OPTIONS[AUTOCOMPLETE_ALIAS_OPTION] = {
|
||||||
autoSelect: true,
|
autoSelect: true,
|
||||||
getPlainText: (eventOrIndex, config, autocompletes) => {
|
|
||||||
let aliasData = eventOrIndex._targetInst ? eventOrIndex._targetInst.memoizedProps.alias : typeof eventOrIndex == "number" && autocompletes.aliases[eventOrIndex];
|
|
||||||
return aliasData.word;
|
|
||||||
},
|
|
||||||
getRawText: (eventOrIndex, config, autocompletes) => {
|
|
||||||
let aliasData = eventOrIndex._targetInst ? eventOrIndex._targetInst.memoizedProps.alias : typeof eventOrIndex == "number" && autocompletes.aliases[eventOrIndex];
|
|
||||||
return aliasData.file ? aliasData.word : BDFDB.StringUtils.insertNRST(aliasData.replace);
|
|
||||||
},
|
|
||||||
getSentinel: _ => "",
|
|
||||||
matches: (channel, guild, currentWord, _, config) => {
|
matches: (channel, guild, currentWord, _, config) => {
|
||||||
if (currentWord.length >= this.settings.amounts.minAliasLength) for (let word in aliases) {
|
if (currentWord.length >= this.settings.amounts.minAliasLength) for (let word in aliases) {
|
||||||
let aliasData = aliases[word];
|
let aliasData = aliases[word];
|
||||||
|
@ -194,6 +185,10 @@ module.exports = (_ => {
|
||||||
description: BDFDB.StringUtils.insertNRST(aliasData.replace)
|
description: BDFDB.StringUtils.insertNRST(aliasData.replace)
|
||||||
}))
|
}))
|
||||||
].flat(10).filter(n => n);
|
].flat(10).filter(n => n);
|
||||||
|
},
|
||||||
|
onSelect: (results, index, _, config) => {
|
||||||
|
config.insertText(results.aliases[index].file ? results.aliases[index].word : BDFDB.StringUtils.insertNRST(results.aliases[index].replace));
|
||||||
|
return {};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue