message

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2021 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input struct {
	*handy.Clamp
	Messages *Messages

	Main  *gtk.Box
	Style *gtk.StyleContext

	Completer *completer.State

	InputBox *gtk.Box
	Input    *gtk.TextView
	InputBuf *gtk.TextBuffer
	Upload   *gtk.Button
	Emoji    *gtk.Button
	Send     *gtk.Button

	Bottom *gtk.Box
	Typing *typing.State

	// | Typing...      | Editing. _Cancel_ |
	EditRevealer *gtk.Revealer
	EditLabel    *gtk.Label
	EditCancel   *gtk.Button

	Editing *discord.Message
}

func NewInput

func NewInput(m *Messages) (i *Input)

type Message

type Message struct {
	*gtk.ListBoxRow

	Nonce    string
	ID       discord.MessageID
	AuthorID discord.UserID
	Author   string
	Webhook  bool

	Timestamp time.Time
	Edited    time.Time

	Condensed      bool
	CondenseOffset time.Duration

	OnUserClick  func(m *Message)
	OnRightClick func(m *Message, btn *gdk.EventButton)
	// contains filtered or unexported fields
}

func NewMessage added in v0.1.0

func NewMessage(s *ningen.State, m *discord.Message) *Message

func NewMessageCustom added in v0.1.0

func NewMessageCustom(message *discord.Message) *Message

func (*Message) HideError added in v0.1.0

func (m *Message) HideError()

HideError hides a message's error, if any.

func (*Message) SetCondensed added in v0.1.0

func (m *Message) SetCondensed(condensed bool)

func (*Message) ShowError added in v0.1.0

func (m *Message) ShowError(err error)

ShowError shows an error on a message.

func (*Message) UpdateAuthor

func (m *Message) UpdateAuthor(s *ningen.State, gID discord.GuildID, u discord.User)

func (*Message) UpdateAvatar

func (m *Message) UpdateAvatar(url string)

func (*Message) UpdateContent

func (m *Message) UpdateContent(s *ningen.State, update *discord.Message)

func (*Message) UpdateExtras

func (m *Message) UpdateExtras(s *ningen.State, update *discord.Message)

func (*Message) UpdateMember

func (m *Message) UpdateMember(s *ningen.State, gID discord.GuildID, n discord.Member)

type Messages

type Messages struct {
	*loadstatus.Page
	Opts

	Main   *gtk.Box
	Column *handy.Clamp

	ScrolledBox *gtk.Box
	LoadMore    *gtk.Button

	Messages *gtk.ListBox

	// Additional components
	Input *Input

	Scroll   *gtk.ScrolledWindow
	Viewport *gtk.Viewport
	// contains filtered or unexported fields
}

func NewMessages

func NewMessages(s *ningen.State, opts Opts) *Messages

func (*Messages) ChannelID added in v0.1.0

func (m *Messages) ChannelID() discord.ChannelID

func (*Messages) Cleanup

func (m *Messages) Cleanup()

func (*Messages) Delete

func (m *Messages) Delete(ids ...discord.MessageID)

func (*Messages) Find added in v0.1.0

func (m *Messages) Find(id discord.MessageID) *Message

func (*Messages) Focus

func (m *Messages) Focus()

Focus on the input box

func (*Messages) GuildID added in v0.1.0

func (m *Messages) GuildID() discord.GuildID

func (*Messages) Insert added in v0.1.0

func (m *Messages) Insert(w *Message)

func (*Messages) LastFromMe

func (m *Messages) LastFromMe() *Message

func (*Messages) Load

func (m *Messages) Load(channelID discord.ChannelID)

func (*Messages) RecentAuthors added in v0.1.0

func (m *Messages) RecentAuthors(limit int) []discord.UserID

func (*Messages) ScrollToBottom

func (m *Messages) ScrollToBottom()

func (*Messages) SetWidth added in v0.0.4

func (m *Messages) SetWidth(width int)

func (*Messages) Update

func (m *Messages) Update(update *discord.Message) (*Message, bool)

func (*Messages) Upsert

func (m *Messages) Upsert(message *discord.Message) *Message

type Opts added in v0.0.4

type Opts struct {
	MessageWidth int
	// InputZeroWidth sets whether or not the sent messages should be
	// "obfuscated" with zero-width space characters, which avoids telemetry
	// somewhat.
	InputZeroWidth bool // true
	// InputOnTyping sets whether or not gtkcord3 should send typing events to
	// the Discord server and announce it.
	InputOnTyping bool // true
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL