forked from OpenGamers/abaddon
bug fix moment
This commit is contained in:
parent
67ee799f04
commit
9fa59479aa
@ -24,9 +24,13 @@ bool Snowflake::IsValid() const {
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, Snowflake &s) {
|
||||
std::string tmp;
|
||||
j.get_to(tmp);
|
||||
s.m_num = std::stoull(tmp);
|
||||
if (j.is_string()) {
|
||||
std::string tmp;
|
||||
j.get_to(tmp);
|
||||
s.m_num = std::stoull(tmp);
|
||||
} else {
|
||||
j.get_to(s.m_num);
|
||||
}
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json &j, const Snowflake &s) {
|
||||
|
@ -5,7 +5,6 @@ void from_json(const nlohmann::json &j, UserSettingsGuildFoldersEntry &m) {
|
||||
JS_D("guild_ids", m.GuildIDs);
|
||||
JS_N("id", m.ID);
|
||||
JS_N("name", m.Name);
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json &j, UserSettings &m) {
|
||||
|
@ -6,7 +6,7 @@
|
||||
struct UserSettingsGuildFoldersEntry {
|
||||
int Color = -1; // null
|
||||
std::vector<Snowflake> GuildIDs;
|
||||
int ID = -1; // null
|
||||
Snowflake ID; // null (this can be a snowflake as a string or an int that isnt a snowflake lol)
|
||||
std::string Name; // null
|
||||
|
||||
friend void from_json(const nlohmann::json &j, UserSettingsGuildFoldersEntry &m);
|
||||
|
@ -23,7 +23,7 @@ int SettingsManager::GetSettingInt(const std::string §ion, const std::string
|
||||
}
|
||||
|
||||
bool SettingsManager::GetSettingBool(const std::string §ion, const std::string &key, bool fallback) const {
|
||||
return GetSettingString(section, key, "false") != "false";
|
||||
return GetSettingString(section, key, fallback ? "true" : "false") != "false";
|
||||
}
|
||||
|
||||
bool SettingsManager::IsValid() const {
|
||||
|
Loading…
Reference in New Issue
Block a user