store data

This commit is contained in:
mimu
2022-10-11 00:10:57 +02:00
parent 28c9b2aeae
commit c282ebb32c
2 changed files with 62 additions and 18 deletions
+16 -3
View File
@@ -10,6 +10,10 @@ import (
tempest "github.com/Amatsagu/Tempest"
)
var channelIDs []tempest.Snowflake = []tempest.Snowflake{
992760761812258868, // test server
}
func main() {
env := getEnvVariables()
@@ -32,12 +36,13 @@ func main() {
},
})
if err := initialize(client); err != nil {
panic(err)
}
client.RegisterCommand(commands.Pinned)
client.SyncCommands([]tempest.Snowflake{
992760761812258868, // test server
}, nil, false)
client.SyncCommands(channelIDs, nil, false)
addr := fmt.Sprintf("%s:%s", env.Addr, env.Port)
@@ -49,6 +54,14 @@ func main() {
}
func initialize(c tempest.Client) error {
if err := commands.InitPinned(c, channelIDs); err != nil {
return err
}
return nil
}
func getEnvVariables() Env {
if os.Getenv("RAILWAY_ENVIRONMENT") == "production" {
return Env{