slack

package module
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const CHANNEL object.Type = "slack.channel"
View Source
const CLIENT object.Type = "slack.client"
View Source
const MESSAGE object.Type = "slack.message"
View Source
const MESSAGE_BUILDER object.Type = "slack.message_builder"
View Source
const USER object.Type = "slack.user"
View Source
const USER_PROFILE object.Type = "slack.user_profile"

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, args ...object.Object) object.Object

func Module

func Module() *object.Module

func NewMessages

func NewMessages(client *slack.Client, msgs []slack.Msg) *object.List

Types

type Channel

type Channel struct {
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(client *slack.Client, channel *slack.Channel) *Channel

func (*Channel) Cost

func (b *Channel) Cost() int

func (*Channel) Equals

func (c *Channel) Equals(other object.Object) object.Object

func (*Channel) GetAttr

func (c *Channel) GetAttr(name string) (object.Object, bool)

func (*Channel) Inspect

func (c *Channel) Inspect() string

func (*Channel) Interface

func (b *Channel) Interface() interface{}

func (*Channel) IsTruthy

func (b *Channel) IsTruthy() bool

func (*Channel) MarshalJSON

func (c *Channel) MarshalJSON() ([]byte, error)

func (*Channel) RunOperation

func (b *Channel) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*Channel) SetAttr

func (b *Channel) SetAttr(name string, value object.Object) error

func (*Channel) Type

func (b *Channel) Type() object.Type

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(client *slack.Client) *Client

func (*Client) AddReaction

func (c *Client) AddReaction(ctx context.Context, args ...object.Object) object.Object

AddReaction adds an emoji reaction to a message

func (*Client) Cost

func (b *Client) Cost() int

func (*Client) CreateConversation

func (c *Client) CreateConversation(ctx context.Context, args ...object.Object) object.Object

CreateConversation creates a new channel, either public or private

func (*Client) DeleteMessage

func (c *Client) DeleteMessage(ctx context.Context, args ...object.Object) object.Object

DeleteMessage deletes a message from a channel

func (*Client) Equals

func (c *Client) Equals(other object.Object) object.Object

func (*Client) GetAttr

func (c *Client) GetAttr(name string) (object.Object, bool)

func (*Client) GetConversationHistory

func (c *Client) GetConversationHistory(ctx context.Context, args ...object.Object) object.Object

GetConversationHistory gets the history of a conversation

func (*Client) GetConversationInfo

func (c *Client) GetConversationInfo(ctx context.Context, args ...object.Object) object.Object

GetConversationInfo gets information about a conversation

func (*Client) GetConversationMembers

func (c *Client) GetConversationMembers(ctx context.Context, args ...object.Object) object.Object

GetConversationMembers gets members of a conversation

func (*Client) GetConversations

func (c *Client) GetConversations(ctx context.Context, args ...object.Object) object.Object

GetConversations gets all conversations for a user

func (*Client) GetUserGroups

func (c *Client) GetUserGroups(ctx context.Context, args ...object.Object) object.Object

GetUserGroups gets all user groups for the team

func (*Client) GetUserInfo

func (c *Client) GetUserInfo(ctx context.Context, args ...object.Object) object.Object

GetUserInfo gets information about a user

func (*Client) GetUsers

func (c *Client) GetUsers(ctx context.Context, args ...object.Object) object.Object

func (*Client) Inspect

func (c *Client) Inspect() string

func (*Client) Interface

func (b *Client) Interface() interface{}

func (*Client) IsTruthy

func (b *Client) IsTruthy() bool

func (*Client) MessageBuilder

func (c *Client) MessageBuilder(ctx context.Context, args ...object.Object) object.Object

func (*Client) PostEphemeralMessage

func (c *Client) PostEphemeralMessage(ctx context.Context, args ...object.Object) object.Object

PostEphemeralMessage sends a message to a channel that is only visible to a single user

func (*Client) PostMessage

func (c *Client) PostMessage(ctx context.Context, args ...object.Object) object.Object

PostMessage sends a message to a channel

func (*Client) RemoveReaction

func (c *Client) RemoveReaction(ctx context.Context, args ...object.Object) object.Object

RemoveReaction removes an emoji reaction from a message

func (*Client) RunOperation

func (b *Client) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*Client) SetAttr

func (b *Client) SetAttr(name string, value object.Object) error

func (*Client) Type

func (b *Client) Type() object.Type

func (*Client) UpdateMessage

func (c *Client) UpdateMessage(ctx context.Context, args ...object.Object) object.Object

UpdateMessage updates a message in a channel

func (*Client) UploadFile

func (c *Client) UploadFile(ctx context.Context, args ...object.Object) object.Object

UploadFile uploads a file to Slack

type GenericIterator

type GenericIterator struct {
	// contains filtered or unexported fields
}

GenericIterator implements a Risor iterator that can be used for any paginated results

func NewConversationIterator

func NewConversationIterator(ctx context.Context, client *slack.Client, params *slack.GetConversationsParameters) *GenericIterator

NewConversationIterator creates a new iterator for Slack conversations

func NewConversationMembersIterator

func NewConversationMembersIterator(ctx context.Context, client *slack.Client, params *slack.GetUsersInConversationParameters) *GenericIterator

NewConversationMembersIterator creates a new iterator for members of a Slack conversation

func NewGenericIterator

func NewGenericIterator(iterType string, nextFn NextFn) *GenericIterator

NewGenericIterator creates a new generic iterator with the given type and next function

func NewMessageIterator

func NewMessageIterator(ctx context.Context, client *slack.Client, params *slack.GetConversationHistoryParameters) *GenericIterator

NewMessageIterator creates a new iterator for messages in a channel

func (*GenericIterator) Cost

func (i *GenericIterator) Cost() int

func (*GenericIterator) Entry

func (i *GenericIterator) Entry() (object.IteratorEntry, bool)

func (*GenericIterator) Equals

func (i *GenericIterator) Equals(other object.Object) object.Object

func (*GenericIterator) GetAttr

func (i *GenericIterator) GetAttr(name string) (object.Object, bool)

func (*GenericIterator) Inspect

func (i *GenericIterator) Inspect() string

func (*GenericIterator) Interface

func (i *GenericIterator) Interface() interface{}

func (*GenericIterator) IsTruthy

func (i *GenericIterator) IsTruthy() bool

func (*GenericIterator) Next

func (i *GenericIterator) Next(ctx context.Context) (object.Object, bool)

Next method returns the next value in the iteration, along with a boolean indicating whether there are more items to iterate over.

func (*GenericIterator) RunOperation

func (i *GenericIterator) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*GenericIterator) SetAttr

func (i *GenericIterator) SetAttr(name string, value object.Object) error

func (*GenericIterator) Type

func (i *GenericIterator) Type() object.Type

type Message

type Message struct {
	// contains filtered or unexported fields
}

Message represents a Slack message

func NewMessage

func NewMessage(client *slack.Client, msg *slack.Message) *Message

func (*Message) Cost

func (b *Message) Cost() int

func (*Message) Equals

func (m *Message) Equals(other object.Object) object.Object

func (*Message) GetAttr

func (m *Message) GetAttr(name string) (object.Object, bool)

func (*Message) GetConversation

func (m *Message) GetConversation(ctx context.Context, args ...object.Object) object.Object

GetConversation retrieves the conversation thread for this message

func (*Message) GetTimestamp

func (m *Message) GetTimestamp(ctx context.Context, args ...object.Object) object.Object

func (*Message) Inspect

func (m *Message) Inspect() string

func (*Message) Interface

func (b *Message) Interface() interface{}

func (*Message) IsBotMessage

func (m *Message) IsBotMessage() bool

func (*Message) IsTruthy

func (b *Message) IsTruthy() bool

func (*Message) MarshalJSON

func (m *Message) MarshalJSON() ([]byte, error)

func (*Message) RunOperation

func (b *Message) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*Message) SetAttr

func (b *Message) SetAttr(name string, value object.Object) error

func (*Message) Text

func (m *Message) Text() string

func (*Message) Type

func (b *Message) Type() object.Type

func (*Message) Username

func (m *Message) Username() string

func (*Message) Value

func (m *Message) Value() *slack.Message

type MessageBuilder

type MessageBuilder struct {
	// contains filtered or unexported fields
}

MessageBuilder helps build rich Slack messages

func NewMessageBuilder

func NewMessageBuilder(client *Client) *MessageBuilder

func (*MessageBuilder) AddDivider

func (b *MessageBuilder) AddDivider(ctx context.Context, args ...object.Object) object.Object

AddDivider adds a divider block to the message

func (*MessageBuilder) AddHeader

func (b *MessageBuilder) AddHeader(ctx context.Context, args ...object.Object) object.Object

AddHeader adds a header block to the message

func (*MessageBuilder) AddSection

func (b *MessageBuilder) AddSection(ctx context.Context, args ...object.Object) object.Object

AddSection adds a section block to the message

func (*MessageBuilder) Build

func (b *MessageBuilder) Build(ctx context.Context, args ...object.Object) object.Object

Build creates a map representing the message with blocks

func (*MessageBuilder) Cost

func (b *MessageBuilder) Cost() int

func (*MessageBuilder) Equals

func (b *MessageBuilder) Equals(other object.Object) object.Object

func (*MessageBuilder) GetAttr

func (b *MessageBuilder) GetAttr(name string) (object.Object, bool)

func (*MessageBuilder) Inspect

func (b *MessageBuilder) Inspect() string

func (*MessageBuilder) Interface

func (b *MessageBuilder) Interface() interface{}

func (*MessageBuilder) IsTruthy

func (b *MessageBuilder) IsTruthy() bool

func (*MessageBuilder) RunOperation

func (b *MessageBuilder) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*MessageBuilder) Send

func (b *MessageBuilder) Send(ctx context.Context, args ...object.Object) object.Object

Send sends the message to a channel

func (*MessageBuilder) SetAttr

func (b *MessageBuilder) SetAttr(name string, value object.Object) error

func (*MessageBuilder) Type

func (b *MessageBuilder) Type() object.Type

type NextFn

type NextFn func(ctx context.Context) (value object.Object, hasNext bool, err error)

NextFn is a function type that produces the next item in an iteration

type User

type User struct {
	// contains filtered or unexported fields
}

func NewUser

func NewUser(client *slack.Client, user *slack.User) *User

NewUser creates a new User object

func (*User) Cost

func (b *User) Cost() int

func (*User) Equals

func (u *User) Equals(other object.Object) object.Object

func (*User) GetAttr

func (u *User) GetAttr(name string) (object.Object, bool)

func (*User) Inspect

func (u *User) Inspect() string

func (*User) Interface

func (b *User) Interface() interface{}

func (*User) IsTruthy

func (b *User) IsTruthy() bool

func (*User) MarshalJSON

func (u *User) MarshalJSON() ([]byte, error)

func (*User) RunOperation

func (b *User) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*User) SetAttr

func (b *User) SetAttr(name string, value object.Object) error

func (*User) Type

func (b *User) Type() object.Type

type UserProfile

type UserProfile struct {
	// contains filtered or unexported fields
}

func NewUserProfile

func NewUserProfile(profile *slack.UserProfile) *UserProfile

func (*UserProfile) Cost

func (b *UserProfile) Cost() int

func (*UserProfile) Equals

func (p *UserProfile) Equals(other object.Object) object.Object

func (*UserProfile) GetAttr

func (p *UserProfile) GetAttr(name string) (object.Object, bool)

func (*UserProfile) Inspect

func (p *UserProfile) Inspect() string

func (*UserProfile) Interface

func (b *UserProfile) Interface() interface{}

func (*UserProfile) IsTruthy

func (b *UserProfile) IsTruthy() bool

func (*UserProfile) MarshalJSON

func (p *UserProfile) MarshalJSON() ([]byte, error)

func (*UserProfile) RunOperation

func (b *UserProfile) RunOperation(opType op.BinaryOpType, right object.Object) object.Object

func (*UserProfile) SetAttr

func (b *UserProfile) SetAttr(name string, value object.Object) error

func (*UserProfile) Type

func (b *UserProfile) Type() object.Type

Jump to

Keyboard shortcuts

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