diff options
| author | ilotterytea <iltsu@alright.party> | 2024-04-30 22:27:09 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2024-04-30 22:27:09 +0500 |
| commit | a47271126bac5c7637fc7763213659fb63e384bd (patch) | |
| tree | 8ae4414e8e8eaaa0a955e5afe53a8798356b7d60 /src | |
| parent | 8b3bb2f83cbfc134aae274e18e92ed022938eb9e (diff) | |
upd: removed id field + renamed to ChannelPreferences
Diffstat (limited to 'src')
| -rw-r--r-- | src/schemas/channel.hpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/schemas/channel.hpp b/src/schemas/channel.hpp index d0c8ab3..a304149 100644 --- a/src/schemas/channel.hpp +++ b/src/schemas/channel.hpp @@ -66,34 +66,32 @@ namespace bot::schemas { std::optional<std::chrono::system_clock::time_point> opted_out_at; }; - class ChannelPreference { + class ChannelPreferences { public: - ChannelPreference(const pqxx::row &row) { - this->id = row[0].as<int>(); - this->channel_id = row[1].as<int>(); + ChannelPreferences(const pqxx::row &row) { + this->channel_id = row[0].as<int>(); if (!row[2].is_null()) { - this->prefix = row[2].as<std::string>(); + this->prefix = row[1].as<std::string>(); } else { this->prefix = DEFAULT_PREFIX; } if (!row[3].is_null()) { - this->locale = row[3].as<std::string>(); + this->locale = row[2].as<std::string>(); } else { this->locale = DEFAULT_LOCALE_ID; } } - ~ChannelPreference() = default; + ~ChannelPreferences() = default; - const int &get_id() const { return this->id; } const int &get_channel_id() const { return this->channel_id; } const std::string &get_prefix() const { return this->prefix; } const std::string &get_locale() const { return this->locale; } private: - int id, channel_id; + int channel_id; std::string prefix, locale; }; } |
