mirror of
https://github.com/aljazceru/signal-cli-rest-api.git
synced 2026-01-26 18:24:25 +01:00
added username support to /v2/send endpoint
This commit is contained in:
44
src/datastructs/datastructs.go
Normal file
44
src/datastructs/datastructs.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
)
|
||||
|
||||
type RecpType int
|
||||
|
||||
const (
|
||||
Number RecpType = iota + 1
|
||||
Username
|
||||
Group
|
||||
)
|
||||
|
||||
type MessageMention struct {
|
||||
Start int64 `json:"start"`
|
||||
Length int64 `json:"length"`
|
||||
Author string `json:"author"`
|
||||
}
|
||||
|
||||
func (s *MessageMention) ToString() string {
|
||||
return fmt.Sprintf("%d:%d:%s", s.Start, s.Length, s.Author)
|
||||
}
|
||||
|
||||
type SendMessageRecipient struct {
|
||||
Identifier string `json:"identifier"`
|
||||
Type string `json:"type"`
|
||||
}
|
||||
|
||||
type SignalCliSendRequest struct {
|
||||
Number string
|
||||
Message string
|
||||
Recipients []string
|
||||
Base64Attachments []string
|
||||
RecipientType RecpType
|
||||
Sticker string
|
||||
Mentions []MessageMention
|
||||
QuoteTimestamp *int64
|
||||
QuoteAuthor *string
|
||||
QuoteMessage *string
|
||||
QuoteMentions []MessageMention
|
||||
TextMode *string
|
||||
EditTimestamp *int64
|
||||
}
|
||||
Reference in New Issue
Block a user