diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-20 02:08:48 -0500 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2021-01-20 02:08:48 -0500 |
commit | a010aa11a559ba22c94dd3426fd1f313ee0ac667 (patch) | |
tree | e5fafac18da04f1c7f6bf7722ec71c428eaba250 /discord/store.hpp | |
parent | 5d1db982cbbb375427b9c4475d5e347c5702b6df (diff) | |
download | abaddon-portaudio-a010aa11a559ba22c94dd3426fd1f313ee0ac667.tar.gz abaddon-portaudio-a010aa11a559ba22c94dd3426fd1f313ee0ac667.zip |
add bans to guild settings, tweak some other things
Diffstat (limited to 'discord/store.hpp')
-rw-r--r-- | discord/store.hpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/discord/store.hpp b/discord/store.hpp index c25cb7c..7559f23 100644 --- a/discord/store.hpp +++ b/discord/store.hpp @@ -26,6 +26,7 @@ public: void SetGuildMember(Snowflake guild_id, Snowflake user_id, const GuildMember &data); void SetPermissionOverwrite(Snowflake channel_id, Snowflake id, const PermissionOverwrite &perm); void SetEmoji(Snowflake id, const EmojiData &emoji); + void SetBan(Snowflake guild_id, Snowflake user_id, const BanData &ban); // slap const on everything even tho its not *really* const @@ -37,9 +38,12 @@ public: std::optional<PermissionOverwrite> GetPermissionOverwrite(Snowflake channel_id, Snowflake id) const; std::optional<RoleData> GetRole(Snowflake id) const; std::optional<UserData> GetUser(Snowflake id) const; + std::optional<BanData> GetBan(Snowflake guild_id, Snowflake user_id) const; + std::vector<BanData> GetBans(Snowflake guild_id) const; void ClearGuild(Snowflake id); void ClearChannel(Snowflake id); + void ClearBan(Snowflake guild_id, Snowflake user_id); using users_type = std::unordered_map<Snowflake, UserData>; using channels_type = std::unordered_map<Snowflake, ChannelData>; @@ -104,6 +108,10 @@ private: mutable sqlite3_stmt *m_get_guild_stmt; mutable sqlite3_stmt *m_set_chan_stmt; mutable sqlite3_stmt *m_get_chan_stmt; + mutable sqlite3_stmt *m_set_ban_stmt; + mutable sqlite3_stmt *m_get_ban_stmt; + mutable sqlite3_stmt *m_clear_ban_stmt; + mutable sqlite3_stmt *m_get_bans_stmt; }; template<typename T> |