Config file missing field to put server ID to have bot connect to the Discord server
sharkck opened this issue · 16 comments
Using latest Forge 2443 integration version 3.0.0 (latest on Curse)
I'm trying to use this for the first time but the mod will not work. First off, I see nowhere to put in the server code. Second, when I did fill out the token and put the channel name where I believe it goes, the mod never seemed to even load properly. Typing in 'discord config reload' gave a nice error posted below the config bit.
"discord": {
"token": "Blah token here",
"ignoresBots": true,
"allowLinking": true,
"ignoresUsers": [],
"channels": {
"generic": {
"commandPrefix": "!",
"canExecuteCommands": false,
"stripMinecraftCodes": true,
"allowDMCommands": false,
"relayChat": true,
"messages": {
"chatMessage": "[{USER}] {MESSAGE}"
},
"commands": []
},
"channels": {frankfurter}
}
},
nothing any further in the config was touched so I didnt include it here.
discord config reload
[03:02:23] [Server thread/WARN] [DiscordIntegration]: [3.0.0] Config had invalid syntax - Please check it using a JSON tool ( https://jsonlint.com/ ) or make sure it have the right content
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: "frankfurter"
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:323)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:313)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:186)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.Gson.fromJson(Gson.java:887)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.Gson.fromJson(Gson.java:825)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at chikachi.discord.core.config.Configuration.loadConfig(Configuration.java:80)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at chikachi.discord.command.SubCommandConfig.execute(SubCommandConfig.java:33)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at chikachi.discord.command.CommandDiscord.func_184881_a(CommandDiscord.java:66)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.feed_the_beast.ftbu.ranks.CmdOverride.func_184881_a(CmdOverride.java:70)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at net.minecraft.command.CommandHandler.func_175786_a(CommandHandler.java:119)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at net.minecraft.command.CommandHandler.func_71556_a(CommandHandler.java:91)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at net.minecraft.server.dedicated.DedicatedServer.func_71333_ah(DedicatedServer.java:427)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:392)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:665)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:523)
[03:02:23] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at java.lang.Thread.run(Unknown Source)
[03:02:23] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:-1]: Caused by: java.lang.NumberFormatException: For input string: "frankfurter"
[03:02:23] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:-1]: at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
[03:02:23] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:-1]: at sun.misc.FloatingDecimal.parseDouble(Unknown Source)
[03:02:23] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:-1]: at java.lang.Double.parseDouble(Unknown Source)
[03:02:23] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:-1]: at com.google.gson.stream.JsonReader.nextLong(JsonReader.java:964)
[03:02:23] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:-1]: at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:321)
[03:02:23] [Server thread/INFO] [STDERR]: [java.lang.Throwable:printStackTrace:-1]: ... 23 more
[03:02:23] [Server thread/INFO]: Config reloaded
The wiki will be updated when v3.1 and 4.0 are ready.
As this issue is stale, i'll close it for now.
thinks to self I really hope that i got my issue in on-time before he left for his vacation!!!! :-Þ
Ok well this is old but I'll help the dev out and tell you what you did wrong. Your json is incorrect. Where you pasted your channel name, you at least need quotes. Refer to the wiki, and also, you didn't use the channel ID, you used the channel name. How is the bot supposed to know what channel to chat in?
A friend of mine is having the same issue. His config is generating wrong.
{
"discord": {
"token": "<Token>",
"ignoresBots": true,
"allowLinking": true,
"ignoresUsers": [],
"channels": "<Channel ID>"
"generic": {
"commandPrefix": "!",
"canExecuteCommands": false,
"stripMinecraftCodes": true,
"allowDMCommands": false,
"relayChat": true,
"messages": {
"chatMessage": "[{USER}] {MESSAGE}"
},
"commands": []
},
"channels":{}
}
},
"minecraft": {
"dimensions": {
"generic": {
"ignoreFakePlayerChat": true,
"relaySayCommand": true,
"relayMeCommand": true,
"canMentionEveryone": false,
"canMentionHere": false,
"messageIgnoreRegex": [],
"relayServerStart": true,
"relayServerStop": true,
"relayServerCrash": true,
"chatPrefix": "",
"canMentionUsers": true,
"canMentionRoles": true,
"discordChannel": true,
"relayAchievements": true,
"relayChat": true,
"relayCommands": true,
"relayPlayerJoin": true,
"relayPlayerLeave": true,
"relayPlayerDeath": true,
"messages": {
"chatMessage": {
"normal": "**[{USER}]** {MESSAGE}",
"webhook": "{MESSAGE}"
},
"command": {
"normal": "**[{USER}]** executed **{COMMAND} {ARGUMENTS}**",
"webhook": "*executed **{COMMAND} {ARGUMENTS}***"
},
"playerJoin": {
"normal": "**{USER}** just joined the server!",
"webhook": "*Joined the server!*"
},
"playerLeave": {
"normal": "**{USER}** just left the server!",
"webhook": "*Left the server!*"
},
"playerDeath": {
"normal": "**{USER}** just died due to {REASON}!",
"webhook": "*{REASON}*"
},
"achievement": {
"normal": "**{USER}** just gained the achievement **{ACHIEVEMENT}**!\n*{DESCRIPTION}*",
"webhook": "*Gained the achievement **{ACHIEVEMENT}**!\n{DESCRIPTION}*"
},
"serverStart": "Server started!",
"serverStop": "Server stopped!",
"serverCrash": "Server crash detected!"
}
},
"dimensions": {}
},
"integrations": {
"dynmapEnabled": true
}
},
"imc": {
"enabled": true,
"mode": "whitelist",
"list": []
}
}
I'll just put mine here, fully functional: https://ghostbin.com/paste/ndbzj
replace my channel, token, and webhook
@thundr What version of DI are you using for that?
Still getting
[10:57:56] [Server thread/WARN] [DiscordIntegration]: [3.0.0] Config had invalid syntax - Please check it using a JSON tool ( https://jsonlint.com/ ) or make sure it have the right content
[10:57:56] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: com.google.gson.JsonSyntaxException: java.lang.NumberFormatException: For input string: "my channel"
[10:57:56] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:323)
[10:57:56] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.TypeAdapters$11.read(TypeAdapters.java:313)
[10:57:56] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:41)
[10:57:56] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:186)
[10:57:56] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:145)
[10:57:56] [Server thread/INFO] [STDERR]: [chikachi.discord.core.config.Configuration:loadConfig:90]: at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:129)
3.0.0, make sure to not put quotes around the channel number in the [] area at the bottom, and double check you filled in every field.
Ok. I got everything updated as you said. It has now loaded successfully. (Thank you! Finally progress!!!)
The only issue I'm seeing now is that nothing is being relayed to the Discord channel. Chat from Discord goes into the game but not vice-versa.
Yeah, I had that problem for a while, it was because I was putting the channel number in quotes, don't do that. (In the "minecraft" section at the bottom.)
Also, the command list should really be deleted, since it doesn't exist anymore, but that's another issue
The only spot that is in quotes is on line 37 with the channel id number.
Does the channel name on line 54 need to be the channel id number as well or the name?
I updated the Minecraft channel to '(numeric value of channel)' to match what you had. Should I remove the parenthesis?
I changed the /discord list to do /forge tps since it doesnt work. Kept online and tps as well. All three seem to work without issue.
Ok. Took the parenthesis out and it now works relaying the chat back to the Discord channel!
Thank you very much for your help!
@thundr , if I may one more time, I've looked over the config file notes at https://github.com/Chikachi/DiscordIntegration/wiki/Config-Explanation-v3 over and over and I'm not seeing a way to get
"integrations": {
"dynmapEnabled": true,
}
to properly work. I've added it into your config before and after dimensions under minecraft and the log errors out "Expected name at line 47 column 6 path $.minecraft.integrations.dynmapEnabled"
The mod was updated, and the docs were not. I would be surprised if all the config options still work, and I bet there are config options that aren't known without looking at source. I don't use dynmap on this server, so I would say just wait until the mod author returns from vacation.