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 {
|
2020-10-27 21:35:22 +00:00
|
|
|
return authenticate.FirstStageAuthenticators()
|
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
|
|
|
}
|