Skip to content

Commit

Permalink
Fix disconnect message decoding error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tnze committed Apr 27, 2024
1 parent 01d0532 commit b893f72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bot/basic/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func attachDisconnect(c *bot.Client, handler func(reason chat.Message) error) {
c.Events.AddListener(bot.PacketHandler{
Priority: 64, ID: packetid.ClientboundDisconnect,
F: func(p pk.Packet) error {
var reason chat.JsonMessage
var reason chat.Message
if err := p.Scan(&reason); err != nil {
return Error{err}
}
Expand Down
2 changes: 1 addition & 1 deletion bot/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *Client) joinLogin(conn *net.Conn) error {
// Handle Packet
switch packetid.ClientboundPacketID(p.ID) {
case packetid.ClientboundLoginDisconnect: // LoginDisconnect
var reason chat.Message
var reason chat.JsonMessage
err = p.Scan(&reason)
if err != nil {
return LoginErr{"disconnect", err}
Expand Down

0 comments on commit b893f72

Please sign in to comment.