Fixes everything I broke 💯

This commit is contained in:
Dalton 2017-09-29 21:39:40 -04:00
parent 6b98e23a0f
commit 4ff2163b49
3 changed files with 5 additions and 6 deletions

View File

@ -47,10 +47,7 @@ public class GuildSettings {
private void load() throws SQLException { private void load() throws SQLException {
if (!checkExists()) { if (!checkExists()) {
Update update = new Update("INSERT INTO `settings` (`guild_id`, `log_enabled`, `log_channel`, `joinMessage`, `quitMessage`, `greetings`, `farewell`," + Update update = new Update("INSERT INTO settings(guild_id, log_enabled, log_channel, joinMessage, quitMessage, greetings, farewell, prefix, joinPm, joinVerification, defaultRole, muteRole) VALUES ('" + guild.getId() + "', '0', 'default_value', 'default_value', 'default_value', 'default_value', 'default_value', '/', 'default', '0', 'default_value', 'default_value');");
" `prefix`, `joinPm`, `joinVerification`, `defaultRole`, `muteRole`, `currency`)" +
" VALUES ('" + guild.getId() + "', '0', 'default_value', 'default_value', 'default_value', 'default_value', 'default_value', '/'," +
" 'default', '0', 'default_value', 'default_value', ' tokens');");
Rixa.getDatabase().send(update); Rixa.getDatabase().send(update);
return; return;
} }

View File

@ -57,7 +57,9 @@ public class UserData {
if (!optional.isPresent()) return; if (!optional.isPresent()) return;
if (!(optional.get() instanceof ResultSet)) return; if (!(optional.get() instanceof ResultSet)) return;
ResultSet set = (ResultSet) optional.get(); ResultSet set = (ResultSet) optional.get();
setExperience(set.getInt("experience")); if (set.next()) {
setExperience(set.getInt("experience"));
}
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -44,7 +44,7 @@ public class MusicModule implements RixaModule {
Update update = new Update("INSERT INTO `music` (`guild_id`, `music_role`, `enabled`) VALUES ('" + guild.getId() + "', 'default_value', '0');"); Update update = new Update("INSERT INTO `music` (`guild_id`, `music_role`, `enabled`) VALUES ('" + guild.getId() + "', 'default_value', '0');");
db.send(update); db.send(update);
} }
Query query = new Query("SELECT * FROM `modules` WHERE `guild_id` = ?"); Query query = new Query("SELECT * FROM `music` WHERE `guild_id` = ?");
query.setString(guild.getId()); query.setString(guild.getId());
Optional<?> optional = Rixa.getDatabase().send(query); Optional<?> optional = Rixa.getDatabase().send(query);
if (!optional.isPresent()) return; if (!optional.isPresent()) return;