Bug Reports for Discord Updates


#1

For those using the Nightly Build with the new Discord Library, report all bugs under this thread. Other threads will be closed out and locked.

Do not request new features on this thread. This is for Bug Reports only. Feature requests will more than likely be deleted from this thread.

Thanks!


PhantomBot Version: 2.3.8-NB-20170818 (Revision: 8fa7d5b)
Discord Module Revamp
#2

To make things simple ill add the bug report where it belongs!

When running the !account link <code> command in twitch chat this error below happens

[08-19-2017 @ 11:52:48.876 BST] [DISCORD] [#JustAlixe] justalixe: !account link
[08-19-2017 @ 11:52:48.904 BST] [DISCORD] [@justalixe#2397] [DM] **NOTE: This expires in 10 minutes**.
**This will automatically remove your previous account link.**
To complete the process of linking your Discord account to your Twitch account, please login to Twitch, go to **https://twitch.tv/justalixe**, and send the command **!account link p1nAzOoq**
[08-19-2017 @ 11:52:57.007 BST] justalixe: !account link p1nAzOoq
[08-19-2017 @ 11:52:57.070 BST] [ERROR] [init.js:298] (hook.call, command, ./discord/core/accountLink.js) TypeError: Cannot find function resolveUserId in object [email protected]

#3

Did you try with the latest nightly build? Thought I fixed that in my last commit.


#4

Nope still a bug im using Revision: 9eca45f its something todo with resolveUserId you fixed the bot name in caps bug latest nightly


#5

Fixed in 9755a43


#6

Doesnt this code need a ; not , at the end

var embedReg = new RegExp(/\(embed\s([\w\W\s\d]+),\s?([\r\n\w\W]*)\)/),
	fileRegMsg = new RegExp(/\(file\s([\w\W]+),\s?([\r\n\w\W]*)\)/),
	fileReg = new RegExp(/(file\s([\w\W]+)/),

cus im not getting syntax errors… lol


#7

Good catch.


#8

error if you need it

[08-20-2017 @ 23:25:38.905 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\misc.js: JavaScript Error: missing variable name (misc.js#25)
[08-20-2017 @ 23:25:38.909 BST] Failed loading "./discord/core/misc.js": JavaException: java.io.IOException: JavaScript Error: missing variable name (misc.js#25)
[08-20-2017 @ 23:25:38.919 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\accountLink.js: TypeError: Cannot set property "resolveTwitchName" of undefined to "
function resolveTwitchName(userId) {
    return ($.inidb.exists("discordToTwitch", userId) ? $.inidb.get("discordToTwitch", userId) : null);
}
" (accountLink.js#142)
[08-20-2017 @ 23:25:38.921 BST] Failed loading "./discord/core/accountLink.js": JavaException: java.io.IOException: TypeError: Cannot set property "resolveTwitchName" of undefined to "
function resolveTwitchName(userId) {
    return ($.inidb.exists("discordToTwitch", userId) ? $.inidb.get("discordToTwitch", userId) : null);
}
" (accountLink.js#142)
[08-20-2017 @ 23:25:38.936 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\patternDetector.js: TypeError: Cannot set property "pattern" of undefined to "[object Object]" (patternDetector.js#76)
[08-20-2017 @ 23:25:38.939 BST] Failed loading "./discord/core/patternDetector.js": JavaException: java.io.IOException: TypeError: Cannot set property "pattern" of undefined to "[object Object]" (patternDetector.js#76)
[08-20-2017 @ 23:25:38.992 BST] Loaded module: discord/core/moderation.js (Enabled)
[08-20-2017 @ 23:25:39.015 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\registerCommand.js: TypeError: Cannot set property "commands" of undefined to "[object Object]" (registerCommand.js#283)
[08-20-2017 @ 23:25:39.019 BST] Failed loading "./discord/core/registerCommand.js": JavaException: java.io.IOException: TypeError: Cannot set property "commands" of undefined to "[object Object]" (registerCommand.js#283)
[08-20-2017 @ 23:25:39.025 BST] [ERROR] [reload()@Script.java:123] Failed to reload module: discord/core/accountLink.js: TypeError: Cannot set property "resolveTwitchName" of undefined to "
function resolveTwitchName(userId) {
    return ($.inidb.exists("discordToTwitch", userId) ? $.inidb.get("discordToTwitch", userId) : null);
}
" (accountLink.js#142)
[08-20-2017 @ 23:25:39.028 BST] Loaded module: discord/core/accountLink.js (Enabled)
[08-20-2017 @ 23:25:39.053 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\commandCooldown.js: TypeError: Cannot set property "cooldown" of undefined to "[object Object]" (commandCooldown.js#227)
[08-20-2017 @ 23:25:39.056 BST] Failed loading "./discord/core/commandCooldown.js": JavaException: java.io.IOException: TypeError: Cannot set property "cooldown" of undefined to "[object Object]" (commandCooldown.js#227)
[08-20-2017 @ 23:25:39.104 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\commands\customCommands.js: TypeError: Cannot set property "loadCustomCommands" of undefined to "
function loadCustomCommands() {
    if ($.bot.isModuleEnabled("./discord/commands/customCommands.js")) {
        var keys = $.inidb.GetKeyList("discordCommands", ""), i;
        for (i = 0; i < keys.length; i++) {
            $.discord.registerCommand("./discord/commands/customCommands.js", keys[i], 0);
        }
    }
}
" (customCommands.js#628)
[08-20-2017 @ 23:25:39.120 BST] Failed loading "./discord/commands/customCommands.js": JavaException: java.io.IOException: TypeError: Cannot set property "loadCustomCommands" of undefined to "
function loadCustomCommands() {
    if ($.bot.isModuleEnabled("./discord/commands/customCommands.js")) {
        var keys = $.inidb.GetKeyList("discordCommands", ""), i;
        for (i = 0; i < keys.length; i++) {
            $.discord.registerCommand("./discord/commands/customCommands.js", keys[i], 0);
        }
    }
}
" (customCommands.js#628)

#9

Fixed in 7d780c7


#10

im still getting some kind of error

[08-20-2017 @ 23:28:23.299 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\misc.js: SyntaxError: Unterminated parenthetical  (misc.js#13)
[08-20-2017 @ 23:28:23.312 BST] Failed loading "./discord/core/misc.js": JavaException: java.io.IOException: SyntaxError: Unterminated parenthetical  (misc.js#13)
[08-20-2017 @ 23:28:23.370 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\accountLink.js: TypeError: Cannot set property "resolveTwitchName" of undefined to "
function resolveTwitchName(userId) {
    return ($.inidb.exists("discordToTwitch", userId) ? $.inidb.get("discordToTwitch", userId) : null);
}
" (accountLink.js#142)
[08-20-2017 @ 23:28:23.398 BST] Failed loading "./discord/core/accountLink.js": JavaException: java.io.IOException: TypeError: Cannot set property "resolveTwitchName" of undefined to "
function resolveTwitchName(userId) {
    return ($.inidb.exists("discordToTwitch", userId) ? $.inidb.get("discordToTwitch", userId) : null);
}
" (accountLink.js#142)
[08-20-2017 @ 23:28:23.416 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\patternDetector.js: TypeError: Cannot set property "pattern" of undefined to "[object Object]" (patternDetector.js#76)
[08-20-2017 @ 23:28:23.436 BST] Failed loading "./discord/core/patternDetector.js": JavaException: java.io.IOException: TypeError: Cannot set property "pattern" of undefined to "[object Object]" (patternDetector.js#76)
[08-20-2017 @ 23:28:23.529 BST] Loaded module: discord/core/moderation.js (Enabled)
[08-20-2017 @ 23:28:23.586 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\registerCommand.js: TypeError: Cannot set property "commands" of undefined to "[object Object]" (registerCommand.js#283)
[08-20-2017 @ 23:28:23.639 BST] Failed loading "./discord/core/registerCommand.js": JavaException: java.io.IOException: TypeError: Cannot set property "commands" of undefined to "[object Object]" (registerCommand.js#283)
[08-20-2017 @ 23:28:23.676 BST] [ERROR] [reload()@Script.java:123] Failed to reload module: discord/core/accountLink.js: TypeError: Cannot set property "resolveTwitchName" of undefined to "
function resolveTwitchName(userId) {
    return ($.inidb.exists("discordToTwitch", userId) ? $.inidb.get("discordToTwitch", userId) : null);
}
" (accountLink.js#142)
[08-20-2017 @ 23:28:23.682 BST] Loaded module: discord/core/accountLink.js (Enabled)
[08-20-2017 @ 23:28:23.695 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\core\commandCooldown.js: TypeError: Cannot set property "cooldown" of undefined to "[object Object]" (commandCooldown.js#227)
[08-20-2017 @ 23:28:23.700 BST] Failed loading "./discord/core/commandCooldown.js": JavaException: java.io.IOException: TypeError: Cannot set property "cooldown" of undefined to "[object Object]" (commandCooldown.js#227)
[08-20-2017 @ 23:28:23.730 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\commands\customCommands.js: TypeError: Cannot set property "loadCustomCommands" of undefined to "
function loadCustomCommands() {
    if ($.bot.isModuleEnabled("./discord/commands/customCommands.js")) {
        var keys = $.inidb.GetKeyList("discordCommands", ""), i;
        for (i = 0; i < keys.length; i++) {
            $.discord.registerCommand("./discord/commands/customCommands.js", keys[i], 0);
        }
    }
}
" (customCommands.js#628)
[08-20-2017 @ 23:28:23.733 BST] Failed loading "./discord/commands/customCommands.js": JavaException: java.io.IOException: TypeError: Cannot set property "loadCustomCommands" of undefined to "
function loadCustomCommands() {
    if ($.bot.isModuleEnabled("./discord/commands/customCommands.js")) {
        var keys = $.inidb.GetKeyList("discordCommands", ""), i;
        for (i = 0; i < keys.length; i++) {
            $.discord.registerCommand("./discord/commands/customCommands.js", keys[i], 0);
        }
    }
}
" (customCommands.js#628)

AND

[08-20-2017 @ 23:28:24.056 BST] [ERROR] [loadScript()@ScriptManager.java:46] Failed to load module: .\scripts\.\discord\systems\pointSystem.js: TypeError: Cannot set property "getUserPoints" of undefined to "
function getUserPoints(id) {
    var username = $.discord.resolveTwitchName(id);
    if (username === null) {
        return 0;
    }
    username = username.toLowerCase();
    return ($.inidb.exists("points", username) ? parseInt($.inidb.get("points", username)) : 0);
}
" (pointSystem.js#74)
[08-20-2017 @ 23:28:24.067 BST] Failed loading "./discord/systems/pointSystem.js": JavaException: java.io.IOException: TypeError: Cannot set property "getUserPoints" of undefined to "
function getUserPoints(id) {
    var username = $.discord.resolveTwitchName(id);
    if (username === null) {
        return 0;
    }
    username = username.toLowerCase();
    return ($.inidb.exists("points", username) ? parseInt($.inidb.get("points", username)) : 0);
}
" (pointSystem.js#74)
[08-20-2017 @ 23:28:24.082 BST] Loaded module: discord/systems/quoteSystem.js (Enabled)
[08-20-2017 @ 23:28:24.237 BST]
[08-20-2017 @ 23:28:25.081 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/core/accountLink.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.085 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/core/moderation.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.109 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/custom/commands/pubgCommand.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.116 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/games/8ball.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.120 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/games/gambling.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.123 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/games/kill.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.129 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/games/random.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.131 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/games/roll.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.134 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/games/roulette.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.137 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/games/slotMachine.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.139 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/bitsHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.146 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/followHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.149 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/gamewispHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.152 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/hostHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.156 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/keywordHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.166 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/streamHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.168 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/streamtipHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.171 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/subscribeHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.178 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/handlers/twitterHandler.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.182 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/systems/greetingsSystem.js) TypeError: Cannot call method "registerCommand" of undefined
[08-20-2017 @ 23:28:25.184 BST] [ERROR] [init.js:306] (hook.call, initReady, ./discord/systems/quoteSystem.js) TypeError: Cannot call method "registerCommand" of undefined

should be getting this color text

seems to be something with fileReg = new RegExp(/(file\s([\w\W]+)/) as if i remove that line error goes away


#11

Was a bad regex, pushing my last fix. If something else break I’ll work on it tomorrow. Appreciate your help.

Fixed in 747c0e9


#12

Thanks for the fast fixes and all working now but :slight_smile:

$.discordAPI.sendPrivateMessage(keys[i], $.lang.get('discord.accountlink.link.success', $.username.resolve(sender)));

doesnt seem to send the message so im just gonna change it to

$.say($.whisperPrefix(sender) + $.lang.get('discord.accountlink.link.success', $.username.resolve(sender)));

so it will reply in twitch for the time being :slight_smile:


#13

!removegame command is not working.

Also, when the stream is ending, it shows that the bot is still playing what is in the stream status :thinking:


#14

@JustAlixe, @Caricatore Fixed in 7dffa74.


#15

This topic was automatically closed after 30 days. New replies are no longer allowed.