bwmarrin / discordgo

(Golang) Go bindings for Discord
BSD 3-Clause "New" or "Revised" License
5.12k stars 817 forks source link

Discordgo error [DG0] wsapi.go:551:onEvent() error unmarshalling READY event, json: cannot unmarshal number into Go struct field ReadState.read_state.last_message_id of type string #773

Open arsalahmed786 opened 4 years ago

arsalahmed786 commented 4 years ago

How to fix this error?

[DG0] wsapi.go:551:onEvent() error unmarshalling READY event, json: cannot unmarshal number into Go struct field ReadState.read_state.last_message_id of type string

bwmarrin commented 4 years ago

Are you using a Bot account or a User account when you get this error?

arsalahmed786 commented 4 years ago

Are you using a Bot account or a User account when you get this error?

My own personal account so it's user account.

arsalahmed786 commented 4 years ago

Still no support, Please help.

bwmarrin commented 4 years ago

This is caused by using a user account instead of a Bot. It's a harmless warning message though and can be completely ignored.

Are you having any other issues that's causing a problem beyond this being printed out in your log files? If someone that uses users bots can test this enough to say this value is always an integer now, then propose a PR to change the field I'm sure it could be approved and clear up this warning notice in your logs.

@coats1337 I'm not sure if you're talking about a separate issue - if so, can you make a new github issue for it?

arsalahmed786 commented 4 years ago

This is caused by using a user account instead of a Bot. It's a harmless warning message though and can be completely ignored.

Are you having any other issues that's causing a problem beyond this being printed out in your log files? If someone that uses users bots can test this enough to say this value is always an integer now, then propose a PR to change the field I'm sure it could be approved and clear up this warning notice in your logs.

@coats1337 I'm not sure if you're talking about a separate issue - if so, can you make a new github issue for it?

Is there any way that i can make it stop printing it? block it somehow.

iopred commented 4 years ago

Removimg ReadState.ReadStateLastMessageID from the Ready Struct should work.

On Tue, Aug 4, 2020, 2:54 AM arsalahmed786 notifications@github.com wrote:

This is caused by using a user account instead of a Bot. It's a harmless warning message though and can be completely ignored.

Are you having any other issues that's causing a problem beyond this being printed out in your log files? If someone that uses users bots can test this enough to say this value is always an integer now, then propose a PR to change the field I'm sure it could be approved and clear up this warning notice in your logs.

@coats1337 https://github.com/coats1337 I'm not sure if you're talking about a separate issue - if so, can you make a new github issue for it?

Is there any way that i can make it stop printing it? block it somehow.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bwmarrin/discordgo/issues/773#issuecomment-668501851, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALVLAVHQNOMD3Z6SOOQB4DR67LG5ANCNFSM4M364SWQ .

arsalahmed786 commented 4 years ago

Removimg ReadState.ReadStateLastMessageID from the Ready Struct should work. On Tue, Aug 4, 2020, 2:54 AM arsalahmed786 @.***> wrote: This is caused by using a user account instead of a Bot. It's a harmless warning message though and can be completely ignored. Are you having any other issues that's causing a problem beyond this being printed out in your log files? If someone that uses users bots can test this enough to say this value is always an integer now, then propose a PR to change the field I'm sure it could be approved and clear up this warning notice in your logs. @coats1337 https://github.com/coats1337 I'm not sure if you're talking about a separate issue - if so, can you make a new github issue for it? Is there any way that i can make it stop printing it? block it somehow. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#773 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AALVLAVHQNOMD3Z6SOOQB4DR67LG5ANCNFSM4M364SWQ .

I don't have this "ReadState.ReadStateLastMessageID" on my sources but i'm still getting this DG0 error is there anyway to hide it? flag to somehow please help me.

Craftzman7 commented 3 years ago

Does anyone know if there is a way to suppress this?

LAD1 commented 2 years ago

For anyone still getting that popup and wanting to suppress it

import (
    "log"
    "io/ioutil"
)

func init() {
    log.SetOutput(ioutil.Discard)
}
Craftzman7 commented 2 years ago

For anyone still getting that popup and wanting to suppress it

Thank you.