1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-12-23 04:46:43 +00:00
cchat-discord/internal/discord/session/restorer.go

20 lines
384 B
Go
Raw Permalink Normal View History

2020-10-07 01:53:15 +00:00
package session
import (
"github.com/diamondburned/cchat"
"github.com/diamondburned/cchat-discord/internal/discord/state"
)
var Restorer cchat.SessionRestorer = restorer{}
type restorer struct{}
func (restorer) RestoreSession(data map[string]string) (cchat.Session, error) {
i, err := state.NewFromData(data)
if err != nil {
return nil, err
}
return NewFromInstance(i)
}