Versions in this module Expand all Collapse all v0 v0.1.1 Oct 5, 2026 Changes in this version + const CodeBadRequest + const CodeInvalidSearchRequest + const DefaultChannelMessagePageSize + const FieldCreatedDateTime + const FieldLastMessagePreviewCreated + const FieldLastModifiedDateTime + const MaxBodyBytes + const MaxBodyDepth + const MaxChatPageSize + const MaxMessagePageSize + const MaxSearchPageSize + var ErrEmptyBody = errors.New("teams: request body has no properties set") + var ErrEmptyID = errors.New("teams: empty identifier") + var ErrEmptySearchTerm = errors.New("teams: search term is empty") + var ErrInvertedWindow = errors.New("teams: message window is inverted: Since is after Before") + var ErrNilGraphClient = errors.New("teams: nil graph client") + func Granted(scopes []string, capability Capability) bool + func IsForbidden(err error) bool + func IsMessagingPolicyBlocked(err error) bool + func IsNotFound(err error) bool + func IsReservedScope(scope string) bool + func IsThrottled(err error) bool + func IsUnauthorized(err error) bool + func LeastPrivilegedScope(capability Capability) (string, bool) + func MostPrivilegedScope(capability Capability) (string, bool) + func NeedsAdminConsent(capability Capability) bool + func Require(scopes []string, capability Capability) error + func ScopesFor(capability Capability) []string + func ScopesToRequest(granted []string, capabilities ...Capability) []string + type Activity string + type Availability string + const AvailabilityAvailable + const AvailabilityAvailableIdle + const AvailabilityAway + const AvailabilityBeRightBack + const AvailabilityBusy + const AvailabilityBusyIdle + const AvailabilityDoNotDisturb + const AvailabilityOffline + const AvailabilityUnknown + type BodyType string + const BodyTypeHTML + const BodyTypeText + type Capability string + const ChangeChat + const ListChannels + const ListChats + const ListTeams + const ReadChannelMessages + const ReadChatMessages + const ReadIdentity + const ReadOwnPresence + const ReadPresence + const SearchMessages + const SendChannelMessage + const SendChatMessage + func Capabilities() []Capability + func MissingFor(scopes []string, capabilities ...Capability) []Capability + func UserConsentable() []Capability + type Channel struct + CreatedDateTime time.Time + Description string + DisplayName string + Email string + ID ChannelID + IsArchived bool + IsFavoriteByDefault bool + Membership ChannelMembership + TenantID string + WebURL string + type ChannelID string + func (i ChannelID) String() string + type ChannelIdentity struct + ChannelID ChannelID + TeamID TeamID + type ChannelMembership string + const ChannelPrivate + const ChannelShared + const ChannelStandard + const ChannelUnknownFutureValue + type ChannelMessageQuery struct + WithReplies bool + func (q ChannelMessageQuery) Params() msgraph.Params + type ChannelQuery struct + Custom url.Values + Select []string + Where msgraph.Expr + func (q ChannelQuery) Params() msgraph.Params + type Chat struct + CreatedDateTime time.Time + ID ChatID + LastMessagePreview *MessagePreview + LastUpdatedDateTime time.Time + Members []ConversationMember + OnlineMeetingInfo *OnlineMeetingInfo + TenantID string + Topic string + Type ChatType + Viewpoint *ChatViewpoint + WebURL string + func (c Chat) DisplayName(self UserID) string + func (c Chat) Unread() (unread, known bool) + type ChatID string + func (i ChatID) String() string + type ChatMessage struct + Attachments []MessageAttachment + Body *ItemBody + ChannelIdentity ChannelIdentity + ChatID ChatID + CreatedDateTime time.Time + DeletedDateTime *time.Time + ETag ETag + EventDetail *EventDetail + From *IdentitySet + ID MessageID + Importance Importance + LastEditedDateTime *time.Time + LastModifiedDateTime time.Time + Locale string + Mentions []Mention + MessageType MessageType + Reactions []Reaction + Replies []ChatMessage + RepliesNextLink string + ReplyToID MessageID + Subject string + Summary string + WebURL string + func (m ChatMessage) Deleted() bool + func (m ChatMessage) Edited() bool + func (m ChatMessage) InlineImages() []HostedContentRef + func (m ChatMessage) IsSystemEvent() bool + func (m ChatMessage) Mine(self UserID) bool + func (m ChatMessage) PlainText() string + func (m ChatMessage) Sender() (Identity, bool) + type ChatQuery struct + ByRecentMessage bool + Custom url.Values + Top int + WithLastMessagePreview bool + WithMembers bool + func (q ChatQuery) Params() msgraph.Params + type ChatType string + const ChatTypeGroup + const ChatTypeMeeting + const ChatTypeOneOnOne + const ChatTypeUnknownFutureValue + type ChatViewpoint struct + IsHidden bool + LastMessageReadDateTime *time.Time + type Client struct + func New(graph *msgraph.Client, opts ...Option) (*Client, error) + func (c *Client) ChannelMembers(ctx context.Context, team TeamID, channel ChannelID) iter.Seq2[ConversationMember, error] + func (c *Client) ChannelMessages(ctx context.Context, team TeamID, channel ChannelID, query ChannelMessageQuery) iter.Seq2[ChatMessage, error] + func (c *Client) Channels(ctx context.Context, team TeamID, query ChannelQuery) iter.Seq2[Channel, error] + func (c *Client) ChatMembers(ctx context.Context, chat ChatID) iter.Seq2[ConversationMember, error] + func (c *Client) Chats(ctx context.Context, query ChatQuery) iter.Seq2[Chat, error] + func (c *Client) GetChannel(ctx context.Context, team TeamID, channel ChannelID) (Channel, *msgraph.Response, error) + func (c *Client) GetChat(ctx context.Context, chat ChatID, query ChatQuery) (Chat, *msgraph.Response, error) + func (c *Client) GetMessage(ctx context.Context, chat ChatID, message MessageID) (ChatMessage, *msgraph.Response, error) + func (c *Client) GetTeam(ctx context.Context, team TeamID) (Team, *msgraph.Response, error) + func (c *Client) Graph() *msgraph.Client + func (c *Client) JoinedTeams(ctx context.Context) iter.Seq2[Team, error] + func (c *Client) ListChats(ctx context.Context, query ChatQuery) (msgraph.Page[Chat], *msgraph.Response, error) + func (c *Client) ListJoinedTeams(ctx context.Context) (msgraph.Page[Team], *msgraph.Response, error) + func (c *Client) ListMessages(ctx context.Context, chat ChatID, query MessageQuery) (msgraph.Page[ChatMessage], *msgraph.Response, error) + func (c *Client) Messages(ctx context.Context, chat ChatID, query MessageQuery) iter.Seq2[ChatMessage, error] + func (c *Client) MoreReplies(ctx context.Context, message ChatMessage) iter.Seq2[ChatMessage, error] + func (c *Client) MyPresence(ctx context.Context) (Presence, *msgraph.Response, error) + func (c *Client) Replies(ctx context.Context, team TeamID, channel ChannelID, message MessageID, ...) iter.Seq2[ChatMessage, error] + func (c *Client) ReplyToChannelMessage(ctx context.Context, team TeamID, channel ChannelID, message MessageID, ...) (ChatMessage, *msgraph.Response, error) + func (c *Client) SearchMessages(ctx context.Context, query SearchQuery) iter.Seq2[SearchHit, error] + func (c *Client) SearchPage(ctx context.Context, query SearchQuery) (hits []SearchHit, more bool, resp *msgraph.Response, err error) + func (c *Client) Self() UserID + func (c *Client) SendChannelMessage(ctx context.Context, team TeamID, channel ChannelID, draft Draft) (ChatMessage, *msgraph.Response, error) + func (c *Client) SendMessage(ctx context.Context, chat ChatID, draft Draft) (ChatMessage, *msgraph.Response, error) + func (c *Client) SetReaction(ctx context.Context, chat ChatID, message MessageID, reaction ReactionType) (*msgraph.Response, error) + func (c *Client) SoftDeleteMessage(ctx context.Context, chat ChatID, message MessageID) (*msgraph.Response, error) + func (c *Client) UndoSoftDeleteMessage(ctx context.Context, chat ChatID, message MessageID) (*msgraph.Response, error) + func (c *Client) UnsetReaction(ctx context.Context, chat ChatID, message MessageID, reaction ReactionType) (*msgraph.Response, error) + func (c *Client) UserPresence(ctx context.Context, user UserID) (Presence, *msgraph.Response, error) + type ConversationMember struct + DisplayName string + Email string + ID string + Roles []MemberRole + UserID UserID + VisibleHistoryStartDateTime *time.Time + type Draft struct + Attachments []MessageAttachment + Body *ItemBody + Importance Importance + Mentions []Mention + Subject string + func (d Draft) IsEmpty() bool + type ETag string + func (e ETag) String() string + type ErrMissingCapability struct + Accepts []string + AdminOnly bool + Capability Capability + func (e *ErrMissingCapability) Error() string + type EventDetail struct + Initiator *IdentitySet + Raw json.RawMessage + Type EventDetailType + func (d *EventDetail) CallDuration() (time.Duration, bool) + func (d *EventDetail) Decode(into any) error + func (d *EventDetail) Known() bool + func (d *EventDetail) MembersAdded() ([]Identity, bool) + func (d *EventDetail) MembersRemoved() ([]Identity, bool) + func (d *EventDetail) NewTopic() (string, bool) + func (d *EventDetail) Summary() (EventSummary, bool) + func (d *EventDetail) UnmarshalJSON(data []byte) error + func (d EventDetail) MarshalJSON() ([]byte, error) + type EventDetailType string + const EventDetailCallEnded + const EventDetailCallStarted + const EventDetailChannelAdded + const EventDetailChannelRenamed + const EventDetailChatRenamed + const EventDetailMeetingEnded + const EventDetailMeetingStarted + const EventDetailMembersAdded + const EventDetailMembersDeleted + const EventDetailMembersJoined + const EventDetailMembersLeft + const EventDetailMessagePinned + const EventDetailMessageUnpinned + const EventDetailTeamsAppInstalled + type EventSummary struct + Actor Identity + Duration time.Duration + Event EventDetailType + Subjects []Identity + Topic string + type HostedContentID string + func (i HostedContentID) String() string + type HostedContentRef struct + Alt string + ID HostedContentID + URL string + type Identity struct + DisplayName string + ID string + Type IdentityType + type IdentityKind string + const IdentityKindApplication + const IdentityKindDevice + const IdentityKindUser + type IdentitySet struct + Application *Identity + Device *Identity + User *Identity + func (s *IdentitySet) Actor() (Identity, IdentityKind, bool) + func (s *IdentitySet) Name() string + type IdentityType string + const IdentityTypeAADUser + const IdentityTypeAnonymousGuest + const IdentityTypeFederatedUser + const IdentityTypeOnPremiseAADUser + const IdentityTypePersonalMicrosoftAccount + const IdentityTypePhoneUser + const IdentityTypeSkypeUser + const IdentityTypeUnknownFutureValue + type Importance string + const ImportanceHigh + const ImportanceNormal + const ImportanceUrgent + type ItemBody struct + Content string + ContentType BodyType + func HTMLBody(content string) *ItemBody + func TextBody(content string) *ItemBody + func (b *ItemBody) Text() string + type MemberRole string + const MemberRoleGuest + const MemberRoleOwner + type Mention struct + ID int32 + MentionText string + Mentioned *MentionedIdentitySet + type MentionedIdentitySet struct + Application *Identity + Conversation *Identity + Device *Identity + Tag *Identity + User *Identity + type MessageAttachment struct + Content string + ContentType string + ContentURL string + ID string + Name string + ThumbnailURL string + type MessageID string + func (i MessageID) String() string + func (i MessageID) Time() (time.Time, bool) + type MessageOrder string + const ByCreated + const ByLastModified + func Newest() MessageOrder + type MessagePreview struct + Body *ItemBody + CreatedDateTime time.Time + EventDetail *EventDetail + From *IdentitySet + ID MessageID + IsDeleted bool + MessageType MessageType + type MessageQuery struct + Before time.Time + Custom url.Values + Order MessageOrder + Since time.Time + Top int + func (q MessageQuery) Params() msgraph.Params + func (q MessageQuery) Validate() error + type MessageType string + const MessageTypeChatEvent + const MessageTypeMessage + const MessageTypeSystemEventMessage + const MessageTypeTyping + const MessageTypeUnknownFutureValue + type OnlineMeetingInfo struct + JoinWebURL string + Organizer *IdentitySet + type Option func(*Client) error + func WithMaxPages(pages int) Option + func WithPageCapNotify(notify func(requested, served int)) Option + func WithPrefer(directives ...msgraph.PreferDirective) Option + func WithSelf(user UserID) Option + type OutOfOfficeSettings struct + IsOutOfOffice bool + Message string + type Presence struct + Activity Activity + Availability Availability + ID UserID + OutOfOffice *OutOfOfficeSettings + StatusMessage *PresenceStatusMessage + type PresenceExpiry struct + DateTime string + TimeZone string + type PresenceStatusMessage struct + ExpiryDateTime *PresenceExpiry + Message *ItemBody + type Reaction struct + CreatedDateTime time.Time + ReactionType ReactionType + User *IdentitySet + type ReactionType string + const ReactionAngry + const ReactionHeart + const ReactionLaugh + const ReactionLike + const ReactionSad + const ReactionSurprised + type SearchHit struct + Message ChatMessage + Rank int32 + Summary string + type SearchQuery struct + Fields []string + From int + Size int + Term string + type Team struct + Description string + DisplayName string + ID TeamID + InternalID string + IsArchived bool + TenantID string + Visibility TeamVisibility + WebURL string + type TeamID string + func (i TeamID) String() string + type TeamVisibility string + const TeamVisibilityHiddenMembership + const TeamVisibilityPrivate + const TeamVisibilityPublic + type UserID string + func (i UserID) String() string