EthanThatOneKid / gitcord

😎 expand GitHub into Discord
MIT License
5 stars 2 forks source link

Dev bug fixes and some cleanup #2

Closed EthanThatOneKid closed 1 year ago

EthanThatOneKid commented 1 year ago

commit ff77ea77c53fa1e0e1b8a8171be1d2394fff794e (HEAD -> eventport, origin/eventport) Author: @diamondburned diamond@arikawa-hi.me Date: Thu Oct 6 03:56:07 2022 -0700

Use ColorScheme map, cleanup Config, add pkg internal/slices

This commit introduces a new ColorScheme map type and a new
ColorSchemeKey enum type that replaces the existing ColorSchemeConfig
structure. This allows for much easier overriding of color schemes.

The new ColorScheme changes also introduces a new colorEnvMap variable
that maps env var prefixes to the respective ColorSchemeKey, which is a
bit cleaner.

The configs are also cleaned up a bit: GuildID is removed, because that
can be obtained from ChannelID, and redundant domain-specific field
names have been cleaned up.

A new package internal/slices is also introduced, which just adds a few
convenient functions for slice-searching and such.

commit 5bc32e8c1bd6d7bc2cce3683ba2228a53f7c5db0 Author: diamondburned diamond@arikawa-hi.me Date: Thu Oct 6 03:37:35 2022 -0700

Move EventID to DoEvent(id)

This commit moves EventID from Config to Client.DoEvent() as an explicit
function parameter.

It's a more reasonable change because the Client is the instance that's
acting on any Event, so it doesn't make sense to construct an entirely
new Client instance just for a single event.

commit b53a9821063e6f02aa92d0479e75d57d5fe8e9cb Author: diamondburned diamond@arikawa-hi.me Date: Thu Oct 6 03:31:19 2022 -0700

Fix incorrect use of sub-clients

This commit fixes the way sub-clients are constructed within
gitcord.Client. It uses pointers properly while using a newly-introduced
function wrapClient to cleanly construct the main client.