1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-12-26 22:16:54 +00:00
cchat-discord/internal/discord/session/restorer.go

20 lines
384 B
Go
Raw 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)
}