MessageUpdate should only update the content
This commit changes MessageUpdate so that it only updates the message content. Updating the username should be up to MessageCreate's Author.
This commit is contained in:
parent
f8c644fa7e
commit
f24feb2002
4
cchat.go
4
cchat.go
|
@ -523,7 +523,9 @@ type MessageHeader interface {
|
|||
// behaves similarly to MessageCreate, except all fields are optional. The
|
||||
// frontend is responsible for checking which field is not empty and check it.
|
||||
type MessageUpdate interface {
|
||||
MessageCreate
|
||||
MessageHeader
|
||||
|
||||
Content() text.Rich
|
||||
}
|
||||
|
||||
// MessagesContainer is a view implementation that displays a list of messages
|
||||
|
|
Binary file not shown.
|
@ -1602,12 +1602,20 @@ var Main = Packages{
|
|||
}, {
|
||||
Comment: Comment{`
|
||||
MessageUpdate is the interface for a message update (or edit)
|
||||
event. It behaves similarly to MessageCreate, except all fields
|
||||
are optional. The frontend is responsible for checking which
|
||||
field is not empty and check it.
|
||||
event. It is only responsible for updating a message's content.
|
||||
The author's name should be updated using MessageCreate's
|
||||
Author.
|
||||
`},
|
||||
Name: "MessageUpdate",
|
||||
Embeds: []EmbeddedInterface{{InterfaceName: "MessageCreate"}},
|
||||
Embeds: []EmbeddedInterface{{InterfaceName: "MessageHeader"}},
|
||||
Methods: []Method{
|
||||
GetterMethod{
|
||||
method: method{Name: "Content"},
|
||||
Returns: []NamedType{{
|
||||
Type: MakeQual("text", "Rich"),
|
||||
}},
|
||||
},
|
||||
},
|
||||
}, {
|
||||
Comment: Comment{`
|
||||
MessageDelete is the interface for a message delete event.
|
||||
|
|
Loading…
Reference in New Issue