bump discordgo and add support for heartbeat sessions (#203)

This commit is contained in:
Skip R.
2025-11-19 14:33:26 -08:00
committed by GitHub
parent 9eaf213091
commit d7292a0706
7 changed files with 62 additions and 20 deletions

20
database/json.go Normal file
View File

@@ -0,0 +1,20 @@
package database
import (
"go.mau.fi/util/dbutil"
)
// Backported from mautrix/go-util@e5cb5e96d15cb87ffe6e5970c2f90ee47980e715.
// JSONPtr is a convenience function for wrapping a pointer to a value in the JSON utility, but removing typed nils
// (i.e. preventing nils from turning into the string "null" in the database).
func JSONPtr[T any](val *T) dbutil.JSON {
return dbutil.JSON{Data: UntypedNil(val)}
}
func UntypedNil[T any](val *T) any {
if val == nil {
return nil
}
return val
}