This method only has heartbeat session population logic for now, so it's
actually a no-op during provisioning. However, there's probably some
value in "mandating" that clients call this shortly after construction,
so we have a chance to run any setup logic that we might need in the
future.
This _feels_ unidiomatic...?
I don't have the logs anymore unfortunately, but I witnessed a
(seemingly?) rare nil dereference _within discordgo's event handling
code_ after Disconnect on the client was called (caused by SIGINT). My
thinking is that this caused the Session to get garbage collected, so
the method receiver became nil out from under it.
To let discordgo clean up after itself, keep a reference to it in the
client.
This comment seems to imply that specifying this function is a shortcut
of sorts, when it's actually required and mautrix-go doesn't fallback to
the connector in the way described.
This was for debugging in development only. Also, bridges default to the
DEBUG level, so this would not be logged at all unless you intentionally
modified your logging configuration.
* Created a separate discordid package to avoid import cycles.
* Implemented attachment bridging. We still need to implement direct
media, but this will do for now.
* Corrected how encrypted files (e.g. embed images and attachments) were
bridged. Previously, the URL field would be empty.
Still a lot of missing pieces. Thoughts:
* Mentions to roles and custom emoji are not rendered properly. We need
to maintain our own DB.
* We might not need the "attachments" leaf package anymore? It's just
there to avoid an import cycle.
Bridging actual events (i.e. wiring up discordgo's event handlers) is
probably next.