FragLand / terracord

:evergreen_tree: A Discord <-> Terraria bridge plugin for TShock
GNU General Public License v3.0
34 stars 14 forks source link

Terracord crashes on attempt to connect to discord #144

Closed Verzacliche closed 3 years ago

Verzacliche commented 3 years ago

I have no idea what's wrong with it, I have no experience with computer languages, I need help with this please.

This is what it looks inside the console.

Terracord: [03/27/2021 03:42:07 +00:00] [Info] Connecting to Discord... Terracord: [03/27/2021 03:42:08 +00:00] [Info] 03:42:08 Discord Discord.Net v2.3.0-dev-20210121.1 (API v6) Terracord: [03/27/2021 03:42:08 +00:00] [Debug] 03:42:08 Rest GET users/@me: 265.29 ms Terracord: [03/27/2021 03:42:08 +00:00] [Error] Unable to connect to Discord: Error converting value 0 to type 'Discord.Optional1[Discord.UserProperties]'. Path 'public_flags', line 1, position 137. [Server API] Warning Plugin "Terracord" has had an unhandled exception thrown by one of its GamePostInitialize handlers: Newtonsoft.Json.JsonSerializationException: Error converting value 0 to type 'Discord.Optional1[Discord.UserProperties]'. Path 'public_flags', line 1, position 137. ---> System.ArgumentException: Could not cast or convert from System.Int64 to Discord.Optional1[Discord.UserProperties]. at Newtonsoft.Json.Utilities.ConvertUtils.EnsureTypeAssignable (System.Object value, System.Type initialType, System.Type targetType) [0x00067] in :0 at Newtonsoft.Json.Utilities.ConvertUtils.ConvertOrCast (System.Object initialValue, System.Globalization.CultureInfo culture, System.Type targetType) [0x00036] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) [0x000bb] in :0 --- End of inner exception stack trace --- at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType (Newtonsoft.Json.JsonReader reader, System.Object value, System.Globalization.CultureInfo culture, Newtonsoft.Json.Serialization.JsonContract contract, System.Type targetType) [0x000eb] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0009b] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue (Newtonsoft.Json.Serialization.JsonProperty property, Newtonsoft.Json.JsonConverter propertyConverter, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerProperty, Newtonsoft.Json.JsonReader reader, System.Object target) [0x00061] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject (System.Object newObject, Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract contract, Newtonsoft.Json.Serialization.JsonProperty member, System.String id) [0x00268] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x00161] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue) [0x0006d] in :0 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent) [0x000db] in :0 at Newtonsoft.Json.JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00053] in :0 at Newtonsoft.Json.JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType) [0x00000] in :0 at Newtonsoft.Json.JsonSerializer.Deserialize[T] (Newtonsoft.Json.JsonReader reader) [0x00000] in :0 at Discord.API.DiscordRestApiClient.DeserializeJson[T] (System.IO.Stream jsonStream) [0x0000e] in <5af06a3543834940b210d1d030407464>:0 at Discord.API.DiscordRestApiClient.SendAsync[TResponse] (System.String method, System.String endpoint, Discord.Net.BucketId bucketId, Discord.Net.Queue.ClientBucketType clientBucket, Discord.RequestOptions options) [0x000cc] in <5af06a3543834940b210d1d030407464>:0 at Discord.API.DiscordRestApiClient.GetMyUserAsync (Discord.RequestOptions options) [0x000ba] in <5af06a3543834940b210d1d030407464>:0 at Discord.Rest.DiscordRestClient.OnLoginAsync (Discord.TokenType tokenType, System.String token) [0x00083] in <5af06a3543834940b210d1d030407464>:0 at Discord.WebSocket.DiscordSocketClient.OnLoginAsync (Discord.TokenType tokenType, System.String token) [0x00073] in <923aae00933043089e7d255fabfd1554>:0 at Discord.Rest.BaseDiscordClient.LoginInternalAsync (Discord.TokenType tokenType, System.String token, System.Boolean validateToken) [0x002c1] in <5af06a3543834940b210d1d030407464>:0 at Discord.Rest.BaseDiscordClient.LoginInternalAsync (Discord.TokenType tokenType, System.String token, System.Boolean validateToken) [0x00372] in <5af06a3543834940b210d1d030407464>:0 at Discord.Rest.BaseDiscordClient.LoginAsync (Discord.TokenType tokenType, System.String token, System.Boolean validateToken) [0x000ef] in <5af06a3543834940b210d1d030407464>:0 at FragLand.TerracordPlugin.Discord.Connect () [0x00165] in :0 at FragLand.TerracordPlugin.Terracord.OnPostInitialize (System.EventArgs args) [0x00012] in :0 at TerrariaApi.Server.HandlerCollection1[ArgsType].Invoke (ArgsType args) [0x0004d] in <f62aa61e7bd440208d5de15125316ac5>:0

ldilley commented 3 years ago

Hello, @Xzcen.

It seems like you are using Mono runtime. Discord.Net (which is the library Terracord uses for Discord connectivity) does not support Mono unfortunately. .NET Framework works fine if you are able to use it. I recommend .NET Framework >=4.7. You can obtain the official runtime from the vendor, Microsoft, here: https://dotnet.microsoft.com/download/dotnet-framework.

Verzacliche commented 3 years ago

Ah I see, thanks for the reply!

On Sat, Mar 27, 2021, 2:16 PM Lloyd Dilley @.***> wrote:

Hello, @Xzcen https://github.com/Xzcen.

It seems like you are using Mono runtime. Discord.Net (which is the library Terracord uses for Discord connectivity) does not support Mono unfortunately. .NET Framework works fine if you are able to use it. I recommend .NET Framework >=4.7. You can obtain the official runtime from the vendor, Microsoft, here: https://dotnet.microsoft.com/download/dotnet-framework.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/FragLand/terracord/issues/144#issuecomment-808667353, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATCURGTPNXBGC6UBIYYTAJLTFVZ27ANCNFSM4Z4O3U3A .