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:
diamondburned 2021-03-20 00:13:39 -07:00
parent f8c644fa7e
commit f24feb2002
3 changed files with 15 additions and 5 deletions

View File

@ -523,7 +523,9 @@ type MessageHeader interface {
// behaves similarly to MessageCreate, except all fields are optional. The // behaves similarly to MessageCreate, except all fields are optional. The
// frontend is responsible for checking which field is not empty and check it. // frontend is responsible for checking which field is not empty and check it.
type MessageUpdate interface { type MessageUpdate interface {
MessageCreate MessageHeader
Content() text.Rich
} }
// MessagesContainer is a view implementation that displays a list of messages // MessagesContainer is a view implementation that displays a list of messages

Binary file not shown.

View File

@ -1602,12 +1602,20 @@ var Main = Packages{
}, { }, {
Comment: Comment{` Comment: Comment{`
MessageUpdate is the interface for a message update (or edit) MessageUpdate is the interface for a message update (or edit)
event. It behaves similarly to MessageCreate, except all fields event. It is only responsible for updating a message's content.
are optional. The frontend is responsible for checking which The author's name should be updated using MessageCreate's
field is not empty and check it. Author.
`}, `},
Name: "MessageUpdate", 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{` Comment: Comment{`
MessageDelete is the interface for a message delete event. MessageDelete is the interface for a message delete event.