For each guild specified in the config, create a space and bridge all
contained text channels that the user has permissions to view.
* Finally add a custom config struct where we accept a list of guild IDs
to bridge. This is intended to be temporary as we flesh out the proper
interfaces for managing which guilds to bridge.
* Defined a custom meta type for portals that holds the containing guild
ID of the channel (if any).
* Transferred the responsibility of building a channel's ChatInfo and
ChatMemberList to the DiscordChatResync event itself.
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.
* 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.