From a47271126bac5c7637fc7763213659fb63e384bd Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Tue, 30 Apr 2024 22:27:09 +0500 Subject: upd: removed id field + renamed to ChannelPreferences --- src/schemas/channel.hpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') 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 opted_out_at; }; - class ChannelPreference { + class ChannelPreferences { public: - ChannelPreference(const pqxx::row &row) { - this->id = row[0].as(); - this->channel_id = row[1].as(); + ChannelPreferences(const pqxx::row &row) { + this->channel_id = row[0].as(); if (!row[2].is_null()) { - this->prefix = row[2].as(); + this->prefix = row[1].as(); } else { this->prefix = DEFAULT_PREFIX; } if (!row[3].is_null()) { - this->locale = row[3].as(); + this->locale = row[2].as(); } 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; }; } -- cgit v1.2.3