minor updates to EmojiModule
This commit is contained in:
parent
b2ffdc088c
commit
c746a6da1a
|
@ -18,3 +18,6 @@ trim_trailing_whitespace = false
|
||||||
|
|
||||||
[*.tsv]
|
[*.tsv]
|
||||||
indent_style = tab
|
indent_style = tab
|
||||||
|
|
||||||
|
[*.yml]
|
||||||
|
indent_size = 2
|
||||||
|
|
|
@ -17,8 +17,9 @@ let emojiSearch = BDModules.get(e => e.default && e.default.getDisambiguatedEmoj
|
||||||
const appSettings = Lightcord.Api.settings
|
const appSettings = Lightcord.Api.settings
|
||||||
|
|
||||||
export default new class EmojiModule {
|
export default new class EmojiModule {
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.init().catch(err => Utils.err("EmojiModule", "An error occured", err)) // better logging
|
this.init().catch(err => Utils.err("EmojiModule", "An error occured", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
async init() {
|
async init() {
|
||||||
|
@ -38,7 +39,7 @@ export default new class EmojiModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(AutocompleteModule && AutoCompletionTemplates && EmojiModuleQuery && Messages && guildModule && emojiSearch){
|
if(AutocompleteModule && AutoCompletionTemplates && EmojiModuleQuery && Messages && guildModule && emojiSearch){
|
||||||
console.log(`Patching getAutocompleteOptions of AutoCompletionTemplates`, AutoCompletionTemplates)
|
Utils.log("EmojiModule", `Patching getAutocompleteOptions of AutoCompletionTemplates`, AutoCompletionTemplates)
|
||||||
const getAutocompleteOptions = AutoCompletionTemplates.getAutocompleteOptions
|
const getAutocompleteOptions = AutoCompletionTemplates.getAutocompleteOptions
|
||||||
AutoCompletionTemplates.getAutocompleteOptions = function(e, t, n, r, a){
|
AutoCompletionTemplates.getAutocompleteOptions = function(e, t, n, r, a){
|
||||||
const value = getAutocompleteOptions.call(this, ...arguments)
|
const value = getAutocompleteOptions.call(this, ...arguments)
|
||||||
|
@ -82,7 +83,7 @@ export default new class EmojiModule {
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error(new Error("Couldn't start autocompletion of Lightcord's emojis."))
|
Utils.err("EmojiModule", "Couldn't start auto-completion of Lightcord's emojis.")
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Emoji display */
|
/** Emoji display */
|
||||||
|
@ -110,7 +111,7 @@ export default new class EmojiModule {
|
||||||
if (typeof(node) !== "string") {
|
if (typeof(node) !== "string") {
|
||||||
newContent.push(node)
|
newContent.push(node)
|
||||||
continue
|
continue
|
||||||
};
|
}
|
||||||
let parsed;
|
let parsed;
|
||||||
let hasParsed = false
|
let hasParsed = false
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ export default class Permissions extends BitField {
|
||||||
* - `MANAGE_WEBHOOKS`
|
* - `MANAGE_WEBHOOKS`
|
||||||
* - `MANAGE_EMOJIS`
|
* - `MANAGE_EMOJIS`
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
* @see {@link https://discordapp.com/developers/docs/topics/permissions}
|
* @see {@link https://discord.com/developers/docs/topics/permissions}
|
||||||
*/
|
*/
|
||||||
static FLAGS:{
|
static FLAGS:{
|
||||||
CREATE_INSTANT_INVITE: number,
|
CREATE_INSTANT_INVITE: number,
|
||||||
|
|
Loading…
Reference in New Issue