✨ 基于事件的消息构成 #1
@ -28,6 +28,10 @@ func newMessageEvent(c *fiber.Ctx) error {
|
|||||||
return fiber.NewError(fiber.StatusBadRequest, "message uuid was not valid")
|
return fiber.NewError(fiber.StatusBadRequest, "message uuid was not valid")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(data.Body.Text) == 0 && len(data.Body.Attachments) == 0 {
|
||||||
|
return fiber.NewError(fiber.StatusBadRequest, "you cannot send an empty message")
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var channel models.Channel
|
var channel models.Channel
|
||||||
var member models.ChannelMember
|
var member models.ChannelMember
|
||||||
@ -84,6 +88,10 @@ func editMessageEvent(c *fiber.Ctx) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(data.Body.Text) == 0 && len(data.Body.Attachments) == 0 {
|
||||||
|
return fiber.NewError(fiber.StatusBadRequest, "you cannot send an empty message")
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var channel models.Channel
|
var channel models.Channel
|
||||||
var member models.ChannelMember
|
var member models.ChannelMember
|
||||||
|
Loading…
Reference in New Issue
Block a user