Skip to content

Commit

Permalink
Fix .opus -> .ogg file extension and update default db filepath
Browse files Browse the repository at this point in the history
  • Loading branch information
chilipizdrick committed Mar 18, 2024
1 parent 3713883 commit 951c6b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Attempt to migrate from terrifying javascript to distinguished golang. (God forg
| `CLIENT_TOKEN` | yes | `string` | Discord bot token |
| `CLIENT_ID` | yes | `string` | Discord bot user ID |
| `GUILD_ID` | no | `string` | Required for registering commands on single server, leave empty for global command registration |
| `SQLITE_DATABASE_FILEPATH` | no | `string` | SQLite database location; will be set to "./userdata.sqlite3.db" if not specified |
| `SQLITE_DATABASE_FILEPATH` | no | `string` | SQLite database location; will be set to "./userdata/userdata.sqlite3.db" if not specified |
| `REGISTER_COMMANDS` | no | `1`/`0`, `true`/`false`, `yes`/`no`, `on`/`off` | Wether to register commands; defaults to disabled |
| `REMOVE_COMMANDS` | no | `1`/`0`, `true`/`false`, `yes`/`no`, `on`/`off` | Wether to remove registered commands; defaults to disabled |
| `GREETING_TIME_INTERVAL` | no | `int` | Time interval between greetings in utix seconds; defaults to 604800 (one week) |
2 changes: 1 addition & 1 deletion commands/register_birthday.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var RegisterBirthdayCommand = utl.SlashCommand{
// Check for supplied database filepath or use the default one
sqliteDatabaseFilepath := os.Getenv("SQLITE_DATABASE_FILEPATH")
if sqliteDatabaseFilepath == "" {
sqliteDatabaseFilepath = "./userdata.sqlite3.db"
sqliteDatabaseFilepath = "./userdata/userdata.sqlite3.db"
}

// Open db connection and create the birthday table if if does not exist
Expand Down
6 changes: 3 additions & 3 deletions events/voice_state_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func greetingHandler(s *discord.Session, e *discord.VoiceStateUpdate) error {
// Check for supplied database filepath or use the default one
sqliteDatabaseFilepath := os.Getenv("SQLITE_DATABASE_FILEPATH")
if sqliteDatabaseFilepath == "" {
sqliteDatabaseFilepath = "./userdata.sqlite3.db"
sqliteDatabaseFilepath = "./userdata/userdata.sqlite3.db"
}

// Open db connection and create the greeting table if if does not exist
Expand Down Expand Up @@ -134,7 +134,7 @@ func greet(s *discord.Session, e *discord.VoiceStateUpdate) error {
return nil
}

const GREETING_FILEPATH = "./assets/audio/greeting.opus"
const GREETING_FILEPATH = "./assets/audio/greeting.ogg"

var audioBuffer [][]byte
err := utl.LoadOpusFile(GREETING_FILEPATH, &audioBuffer)
Expand Down Expand Up @@ -165,7 +165,7 @@ func birthdayHandler(s *discord.Session, e *discord.VoiceStateUpdate) error {
// Check for supplied database filepath or use the default one
sqliteDatabaseFilepath := os.Getenv("SQLITE_DATABASE_FILEPATH")
if sqliteDatabaseFilepath == "" {
sqliteDatabaseFilepath = "./userdata.sqlite3.db"
sqliteDatabaseFilepath = "./userdata/userdata.sqlite3.db"
}

// Open db connection and create the birthday table if if does not exist
Expand Down

0 comments on commit 951c6b6

Please sign in to comment.