thecatcore / Fabric---Discord-Link

MIT License
75 stars 31 forks source link

atATellRaw is throwing an exception #193

Open BreadMoirai opened 2 years ago

BreadMoirai commented 2 years ago

Describe the bug When sending tellraw @a messages in minecraft. It does not send it to discord with the config option atATellRaw set to true

Reproduction steps

  1. Use /tellraw @a {"text":"hello"}

Expected behaviour Message should have been sent

Crash report ``` [13:25:21] [Server thread/INFO]: [STDERR]: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0 [13:25:21] [Server thread/INFO]: [STDERR]: at fr.arthurbambou.fdlink.discordstuff.DiscordWebhook.sendMessage(DiscordWebhook.java:117) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3146.md01e10c$lambda$register$1$0(class_3146.java:558) [13:25:21] [Server thread/INFO]: [STDERR]: at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:263) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2170.redirect$zzk000$performCommand(class_2170.java:547) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2170.method_9249(class_2170.java:264) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3244.method_14370(class_3244.java:1253) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3244.method_31286(class_3244.java:1237) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3244.method_12048(class_3244.java:1220) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2797.method_12115(class_2797.java:30) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2797.method_11054(class_2797.java:7) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_2600.method_11072(class_2600.java:22) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_3738.run(class_3738.java:18) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.method_18859(class_1255.java:157) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_4093.method_18859(class_4093.java:23) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_24306(MinecraftServer.java:808) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_18859(MinecraftServer.java:165) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.method_16075(class_1255.java:131) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_20415(MinecraftServer.java:790) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_16075(MinecraftServer.java:784) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.class_1255.method_5383(class_1255.java:116) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_16208(MinecraftServer.java:768) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:701) [13:25:21] [Server thread/INFO]: [STDERR]: at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:273) [13:25:21] [Server thread/INFO]: [STDERR]: at java.base/java.lang.Thread.run(Thread.java:833) ```

Additional context

fdlink.json ```json { "token": "...", "chatChannels": [ "952819730006286358" ], "logChannels": [], "webhook": { "url": "https://discord.com/api/webhooks/952823437209010196/...", "mentions": { "everyone": false, "roles": false, "users": true } }, "ignoreBots": true, "activityUpdateInterval": 15, "minecraftToDiscord": { "general": { "enableDebugLogs": false }, "chatChannels": { "commandPrefix": "!", "allowDiscordCommands": true, "serverStartingMessage": false, "serverStartMessage": true, "serverStopMessage": false, "serverStoppingMessage": true, "customChannelDescription": false, "minecraftToDiscordTag": false, "minecraftToDiscordDiscriminator": false, "playerMessages": true, "teamPlayerMessages": true, "joinAndLeaveMessages": true, "advancementMessages": true, "challengeMessages": true, "goalMessages": true, "deathMessages": true, "sendMeCommand": true, "sendSayCommand": true, "adminMessages": false, "atATellRaw": true, "achievementMessages": true }, "logChannels": { "serverStartingMessage": true, "serverStartMessage": true, "serverStopMessage": true, "serverStoppingMessage": true, "customChannelDescription": false, "minecraftToDiscordTag": false, "minecraftToDiscordDiscriminator": false, "playerMessages": false, "teamPlayerMessages": false, "joinAndLeaveMessages": true, "advancementMessages": false, "challengeMessages": false, "goalMessages": false, "deathMessages": true, "sendMeCommand": true, "sendSayCommand": true, "adminMessages": true, "atATellRaw": false, "achievementMessages": true } }, "discordToMinecraft": { "pingLongVersion": false }, "emojiMap": [ { "name": "example_name", "id": ":example_id:22222222" }, { "name": "example_name2", "id": ":example_id2:22222222" } ], "version": 9 } ```
DBTDerpbox commented 2 years ago

i've noticed that it seems to only do this with webhooks enabled, with it disabled it sends messages correctly