-
-
Notifications
You must be signed in to change notification settings - Fork 9
mattermost IMattermostClient
Mattermost client interface.
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph Mattermost
Mattermost.IMattermostClient[[IMattermostClient]]
class Mattermost.IMattermostClient interfaceStyle;
end
| Type | Name | Methods |
|---|---|---|
User |
CurrentUserInfoBot user information. |
get |
Uri |
ServerAddressBase server address. |
get |
| Returns | Name |
|---|---|
Task<ChannelUserInfo> |
AddUserToChannelAsync(string channelId, string userId)Add user to channel. |
Task<bool> |
ArchiveChannelAsync(string channelId)Archive channel by specified channel identifier. |
Task<Channel> |
CreateChannelAsync(string teamId, string name, string displayName, ChannelType channelType, string purpose, string header)Create simple channel with specified users. |
Task<Channel> |
CreateGroupChannelAsync(string``[] userIds)Create group channel with specified users. |
Task<bool> |
DeletePostAsync(string postId)Delete post with specified post identifier. |
Task<bool> |
DeleteUserFromChannelAsync(string channelId, string userId)Delete user from channel. |
Task<Channel> |
FindChannelByName(string teamId, string channelName)Find channel by channel name and team identifier. |
Task<byte``[]> |
GetFileAsync(string fileId)Get file by identifier. |
Task<FileDetails> |
GetFileDetailsAsync(string fileId)Get file details by specified identifier. |
Task<Post> |
GetPostAsync(string postId)Get post by identifier. |
Task<User> |
GetUserAsync(string userId)Get user by identifier. |
Task<User> |
GetUserByUsernameAsync(string username)Get user by username. |
Task<Post> |
SendMessageAsync(string channelId, string message, string replyToPostId, MessagePriority priority, IEnumerable<string> files) |
Task<bool> |
SetChannelCallStateAsync(string channelId, bool isCallsEnabled)Set call state for channel identifier. |
Task |
StartReceivingAsync(...)Create receiver Task with websocket polling. |
Task<Post> |
UpdatePostAsync(string postId, string newText)Update message text for specified post identifier. |
Task<FileDetails> |
UploadFileAsync(string channelId, string filePath, Action<int> progressChanged) |
Mattermost client interface.
public Task StartReceivingAsync()Create receiver Task with websocket polling.
Receiver task.
public Task StartReceivingAsync(CancellationToken cancellationToken)| Type | Name | Description |
|---|---|---|
CancellationToken |
cancellationToken |
Create receiver Task with websocket polling.
Receiver task.
public Task<Post> SendMessageAsync(string channelId, string message, string replyToPostId, MessagePriority priority, IEnumerable<string> files)| Type | Name | Description |
|---|---|---|
string |
channelId | |
string |
message | |
string |
replyToPostId | |
MessagePriority |
priority | |
IEnumerable<string> |
files |
public Task<Post> UpdatePostAsync(string postId, string newText)| Type | Name | Description |
|---|---|---|
string |
postId | Post identifier. |
string |
newText | New message text (Markdown supported). |
Update message text for specified post identifier.
Updated post.
public Task<bool> DeletePostAsync(string postId)| Type | Name | Description |
|---|---|---|
string |
postId | Post identifier. |
Delete post with specified post identifier.
True if deleted, otherwise false.
public Task<Channel> CreateGroupChannelAsync(string[] userIds)| Type | Name | Description |
|---|---|---|
string``[] |
userIds | Participant users. |
Create group channel with specified users.
Created channel info.
public Task<Channel> CreateChannelAsync(string teamId, string name, string displayName, ChannelType channelType, string purpose, string header)| Type | Name | Description |
|---|---|---|
string |
teamId | Team identifier. |
string |
name | Channel name. |
string |
displayName | Channel display name. |
ChannelType |
channelType | Channel type: open or private. |
string |
purpose | Channel purpose (optional). |
string |
header | Channel header (optional). |
Create simple channel with specified users.
Created channel info.
public Task<User> GetUserAsync(string userId)| Type | Name | Description |
|---|---|---|
string |
userId | User identifier. |
Get user by identifier.
User information.
public Task<ChannelUserInfo> AddUserToChannelAsync(string channelId, string userId)| Type | Name | Description |
|---|---|---|
string |
channelId | Channel identifier. |
string |
userId | User identifier. |
Add user to channel.
Channel user information.
public Task<bool> DeleteUserFromChannelAsync(string channelId, string userId)| Type | Name | Description |
|---|---|---|
string |
channelId | Channel identifier. |
string |
userId | User identifier. |
Delete user from channel.
True if deleted, otherwise false.
public Task<User> GetUserByUsernameAsync(string username)| Type | Name | Description |
|---|---|---|
string |
username | Username. |
Get user by username.
User information.
public Task<FileDetails> UploadFileAsync(string channelId, string filePath, Action<int> progressChanged)| Type | Name | Description |
|---|---|---|
string |
channelId | |
string |
filePath | |
Action<int> |
progressChanged |
public Task<FileDetails> GetFileDetailsAsync(string fileId)| Type | Name | Description |
|---|---|---|
string |
fileId | File identifier. |
Get file details by specified identifier.
File details.
public Task<Channel> FindChannelByName(string teamId, string channelName)| Type | Name | Description |
|---|---|---|
string |
teamId | Team identifier where channel is exists. |
string |
channelName | Channel name. |
Find channel by channel name and team identifier.
Channel info.
public Task<bool> SetChannelCallStateAsync(string channelId, bool isCallsEnabled)| Type | Name | Description |
|---|---|---|
string |
channelId | Channel identifier where calls must be in specified state. |
bool |
isCallsEnabled | New state. |
Set call state for channel identifier.
True if calls state setted, otherwise false.
public Task<bool> ArchiveChannelAsync(string channelId)| Type | Name | Description |
|---|---|---|
string |
channelId | Channel identifier. |
Archive channel by specified channel identifier.
True if archieved, otherwise false.
public Task<Post> GetPostAsync(string postId)| Type | Name | Description |
|---|---|---|
string |
postId | Post identifier. |
Get post by identifier.
Post information.
public Task<byte> GetFileAsync(string fileId)| Type | Name | Description |
|---|---|---|
string |
fileId | File identifier. |
Get file by identifier.
File bytes.
public User CurrentUserInfo { get; }Bot user information.
public Uri ServerAddress { get; }Base server address.
public event EventHandler<MessageEventArgs> OnMessageReceivedEvent called in independent thread when new message received.
public event EventHandler<LogEventArgs> OnLogMessageEvent callen in independent thread when log message created.
Generated with ModularDoc