cchat-discord/discord.go

40 lines
826 B
Go
Raw Normal View History

2020-09-08 04:44:09 +00:00
package discord
import (
"github.com/diamondburned/cchat"
2020-10-07 01:53:15 +00:00
"github.com/diamondburned/cchat-discord/internal/discord/authenticate"
2020-09-08 04:44:09 +00:00
"github.com/diamondburned/cchat-discord/internal/discord/session"
"github.com/diamondburned/cchat/services"
"github.com/diamondburned/cchat/text"
2020-10-07 01:53:15 +00:00
"github.com/diamondburned/cchat/utils/empty"
2020-09-08 04:44:09 +00:00
)
2020-10-07 01:53:15 +00:00
var service cchat.Service = Service{}
2020-09-08 04:44:09 +00:00
func init() {
2020-10-07 01:53:15 +00:00
services.RegisterService(service)
2020-09-08 04:44:09 +00:00
}
2020-10-07 01:53:15 +00:00
type Service struct {
empty.Service
}
2020-09-08 04:44:09 +00:00
func (Service) Name() text.Rich {
return text.Rich{Content: "Discord"}
}
2020-10-27 05:04:55 +00:00
func (Service) Authenticate() []cchat.Authenticator {
return []cchat.Authenticator{
authenticate.New(),
authenticate.NewDiscordLogin(),
}
2020-09-08 04:44:09 +00:00
}
2020-10-07 01:53:15 +00:00
func (Service) AsIconer() cchat.Iconer {
return Logo
2020-09-08 04:44:09 +00:00
}
2020-10-07 01:53:15 +00:00
func (Service) AsSessionRestorer() cchat.SessionRestorer {
return session.Restorer
2020-09-08 04:44:09 +00:00
}