Documentation ¶
Index ¶
Constants ¶
const ( // MessageLengthLimitNonNitro is the maximum number of characters allowed in a message. MessageLengthLimitNonNitro = 2000 // MessageLengthLimitNitro is the maximum number of characters allowed in a // message if the user has Nitro. MessageLengthLimitNitro = 4000 )
Variables ¶
This section is empty.
Functions ¶
func NewEmojiCompleter ¶
func NewEmojiCompleter(gID discord.GuildID) autocomplete.Searcher
NewEmojiCompleter creaets a new autocomplete searcher that searches for emojis.
func NewMemberCompleter ¶
func NewMemberCompleter(chID discord.ChannelID) autocomplete.Searcher
NewMemberCompleter creates a new autocomplete searcher that searches for members.
Types ¶
type Controller ¶
type Controller interface { SendMessage(SendingMessage) StopEditing() StopReplying() EditLastMessage() bool AddReaction(discord.MessageID, discord.APIEmoji) AddToast(*adw.Toast) }
Controller is the parent Controller for a View.
type EmojiData ¶
type EmojiData struct { GuildID discord.GuildID GuildName string Emoji *discord.Emoji EmojiName string }
EmojiData is the Data structure for each emoji.
type File ¶
type File struct { Name string Type string // MIME type Size int64 Open func() (io.ReadCloser, error) }
File contains the filename and a callback to open the file that's called asynchronously.
func (*File) SetSpoiler ¶ added in v0.0.28
SetSpoiler sets the spoilered state of the file.
type Input ¶
type Input struct { *gtk.TextView Buffer *gtk.TextBuffer // contains filtered or unexported fields }
Input is the text field of the composer.
type InputController ¶
type InputController interface { // Send sends or edits everything in the current message buffer state. Send() // Escape is called when the Escape key is pressed. It is meant to stop any // ongoing action and return true, or false if no action. Escape() bool // EditLastMessage is called when the user wants to edit their last message. // False is returned if no messages can be found. EditLastMessage() bool // PasteClipboardFile is called everytime the user pastes a file from their // clipboard. The file is usually (but not always) an image. PasteClipboardFile(*File) // UpdateMessageLength updates the message length counter. UpdateMessageLength(int) }
InputController is the parent controller that Input controls.
type MemberData ¶
MemberData is the Data structure for each member.
func (MemberData) Row ¶
func (d MemberData) Row(ctx context.Context) *gtk.ListBoxRow
type SendingMessage ¶
type SendingMessage struct { Content string Files []*File ReplyingTo discord.MessageID ReplyMention bool }
SendingMessage is the message created to be sent.
type UploadTray ¶
type UploadTray struct { *gtk.Box // contains filtered or unexported fields }
UploadTray is the tray holding files to be uploaded.
func (*UploadTray) AddFile ¶
func (t *UploadTray) AddFile(f *File)
AddFile adds a file into the tray.
func (*UploadTray) Clear ¶
func (t *UploadTray) Clear() []*File
Clear clears the tray and returns the list of paths that it held.
func (*UploadTray) Files ¶
func (t *UploadTray) Files() []*File
Files returns the list of files in the tray.
type View ¶
type View struct { *gtk.Widget Input *Input Placeholder *gtk.Label UploadTray *UploadTray EmojiChooser *gtk.EmojiChooser // contains filtered or unexported fields }
func (*View) ResetPlaceholder ¶
func (v *View) ResetPlaceholder()
func (*View) SetPlaceholderMarkup ¶
SetPlaceholder sets the composer's placeholder. The default is used if an empty string is given.
func (*View) StartEditing ¶
StartEditing starts editing the given message. The message is edited once the user hits send.
func (*View) StartReplyingTo ¶
StartReplyingTo starts replying to the given message. Visually, there is no difference except for the send button being different.