Skip to content

Commit

Permalink
細かな修正
Browse files Browse the repository at this point in the history
  • Loading branch information
kosugikun committed Mar 28, 2023
1 parent b9c796a commit 3d7923f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<artifactId>kotlin-test-junit</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/dev/cosgy/textToSpeak/Bot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import dev.cosgy.textToSpeak.settings.UserSettingsManager
import net.dv8tion.jda.api.JDA
import net.dv8tion.jda.api.entities.Guild
import org.apache.commons.io.FileUtils
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.io.File
import java.io.IOException
Expand All @@ -41,7 +42,7 @@ class Bot(val waiter: EventWaiter, val config: BotConfig, val settingsManager: S
val voiceCreation: VoiceCreation
val userSettingsManager: UserSettingsManager
val aloneInVoiceHandler: AloneInVoiceHandler
var log = LoggerFactory.getLogger(this.javaClass)
var log: Logger = LoggerFactory.getLogger(this.javaClass)
var dictionary: Dictionary? = null
private set
private var shuttingDown = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ import com.jagrosh.jdautilities.command.CommandEvent
import com.jagrosh.jdautilities.command.SlashCommandEvent
import dev.cosgy.textToSpeak.Bot
import dev.cosgy.textToSpeak.commands.AdminCommand
import org.slf4j.Logger
import org.slf4j.LoggerFactory

class SetReadNameCmd(private val bot: Bot) : AdminCommand() {
var log = LoggerFactory.getLogger(this.javaClass)
var log: Logger = LoggerFactory.getLogger(this.javaClass)

init {
name = "setreadname"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ import java.sql.SQLException
// limitations under the License. /
//////////////////////////////////////////////////////////////////////////////////////////
class UserSettingsManager {
private val settings: HashMap<Long, UserSettings>
private val settings: HashMap<Long, UserSettings> = HashMap()
private val logger = LoggerFactory.getLogger(this.javaClass)
private var connection: Connection? = null

init {
settings = HashMap()
val path = OtherUtil.getPath("UserData.sqlite")
var create = false
if (!path!!.toFile().exists()) {
create = true
if (!path.toFile().exists()) {
val original = OtherUtil.loadResource(this, "UserData.sqlite")
try {
FileUtils.writeStringToFile(path.toFile(), original, StandardCharsets.UTF_8)
Expand Down

0 comments on commit 3d7923f

Please sign in to comment.