2020-06-04 23:00:41 +00:00
|
|
|
package input
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/diamondburned/cchat"
|
|
|
|
"github.com/diamondburned/cchat/text"
|
|
|
|
)
|
|
|
|
|
|
|
|
type SendMessageData struct {
|
2020-06-07 07:06:13 +00:00
|
|
|
content string
|
|
|
|
author text.Rich
|
|
|
|
authorID string
|
|
|
|
authorURL string // avatar
|
|
|
|
nonce string
|
2020-06-04 23:00:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type PresendMessage interface {
|
|
|
|
cchat.SendableMessage
|
|
|
|
cchat.MessageNonce
|
|
|
|
|
|
|
|
Author() text.Rich
|
|
|
|
AuthorID() string
|
2020-06-07 07:06:13 +00:00
|
|
|
AuthorAvatarURL() string // may be empty
|
2020-06-04 23:00:41 +00:00
|
|
|
}
|
|
|
|
|
2020-06-07 07:25:13 +00:00
|
|
|
var _ PresendMessage = (*SendMessageData)(nil)
|
2020-06-04 23:00:41 +00:00
|
|
|
|
|
|
|
func (s SendMessageData) Content() string {
|
|
|
|
return s.content
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s SendMessageData) Author() text.Rich {
|
|
|
|
return s.author
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s SendMessageData) AuthorID() string {
|
|
|
|
return s.authorID
|
|
|
|
}
|
|
|
|
|
2020-06-07 07:06:13 +00:00
|
|
|
func (s SendMessageData) AuthorAvatarURL() string {
|
|
|
|
return s.authorURL
|
|
|
|
}
|
|
|
|
|
2020-06-04 23:00:41 +00:00
|
|
|
func (s SendMessageData) Nonce() string {
|
|
|
|
return s.nonce
|
|
|
|
}
|