switchupcb / disgo

Create a Discord Bot in Go using this Discord API Wrapper. The next generation of Discord API Consumption.
Apache License 2.0
88 stars 2 forks source link

Issues from Arikawa #25

Closed switchupcb closed 2 years ago

switchupcb commented 2 years ago

Disgo solves the following problems from https://github.com/diamondburned/arikawa/issues.

switchupcb commented 2 years ago

The following issues have occurred due to an incorrect type definition or non-existent type definition:

Disgo avoids these issues through the usage of Dasgo. In short, @diamondburned may benefit from using Dasgo to stay up-to-date while reducing maintenance load.

switchupcb commented 2 years ago

https://github.com/diamondburned/arikawa/issues/39 occurs due to a custom API that is not machine generated.

switchupcb commented 2 years ago

In issue https://github.com/diamondburned/arikawa/issues/44, @mavolin points out the issue with using functions that accept parameters. The provided solution adheres to ariwaka's dedication to provide functions, which means that certain functions require parameters while others accept structs. In contrast, every "request" in Disgo is a struct with one reliable Send() function.

switchupcb commented 2 years ago

Hey @diamondburned, an example to the solution to https://github.com/diamondburned/arikawa/issues/153 can be viewed in request.go Line 304. One thing we are unsure about is whether floating point precision can cause reading a Retry-After header to be slightly incorrect; which has implications if it's set too early.

switchupcb commented 2 years ago

I'm not sure what the cause of https://github.com/diamondburned/arikawa/issues/286 is, but @no3371 states that he attempts create a connect call when Discord issues a reconnection. We avoid this issue from occurring in two ways:

  1. When Discord issues an Opcode 7, we reconnect.
  2. When a user attempts to Connect() a session that is already connected, this results in an error.
switchupcb commented 2 years ago

https://github.com/diamondburned/arikawa/issues/309 is an issue (by @hi117) that focuses on ariwaka's use of reflection. Disgo avoids reflection and type assertion through the use of Copygen, which generates all event handling functionality.

switchupcb commented 2 years ago

https://github.com/diamondburned/arikawa/issues/324 is addressed by tracking the amount of heartbeats we have received since the last time a Heartbeat was sent. The counter for heartbeat acks is incremented when an Opcode 1 Heartbeat or Opcode 11 Heartbeat is received. The counter is cleared when a Heartbeat is sent. This ensure that Disgo will detect when a Heartbeat has not been sent in an entire interval since it would have not received a Heartbeat or HeartbeatACK from the other side of the WebSocket Connection.

Source: https://github.com/switchupcb/disgo/blob/v10/wrapper/session_heartbeat.go#L63