Skip to content

Commit

Permalink
辞書DBが更新されない不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kosugikun committed Jul 9, 2023
1 parent 6d50586 commit fd86636
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/dev/cosgy/textToSpeak/audio/Dictionary.kt
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,12 @@ class Dictionary private constructor(bot: Bot) {
}

private fun executeUpdate(guildId: Long, word: String?, reading: String?) {
val sql = "INSERT INTO Dictionary VALUES (?,?,?) ON CONFLICT (guild_id, word) DO UPDATE SET reading = ?"
val sql = "INSERT OR REPLACE INTO Dictionary(guild_id, word, reading) VALUES (?,?,?)"
try {
connection.prepareStatement(sql).use { ps ->
ps.setLong(1, guildId)
ps.setString(2, word)
ps.setString(3, reading)
ps.setString(4, reading)
ps.executeUpdate()
}
} catch (throwables: SQLException) {
Expand Down

0 comments on commit fd86636

Please sign in to comment.