slidge.plugins.mattermost.api#

Module Contents#

Classes#

Functions#

demojize(emoji_char)

Attributes#

log

exception slidge.plugins.mattermost.api.MattermostException[source]#

Bases: Exception

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

exception slidge.plugins.mattermost.api.ContactNotFound[source]#

Bases: MattermostException

Common base class for all non-exit exceptions.

Initialize self. See help(type(self)) for accurate signature.

class slidge.plugins.mattermost.api.MattermostClient(*args, **kwargs)[source]#
async login()[source]#
async get_contacts()[source]#
Return type

list[str]

async get_channel_members(channel_id, *, page=0, per_page=10)[source]#
Parameters
  • channel_id (str) –

  • page (int) –

  • per_page (int) –

async get_users_by_ids(user_ids)[source]#
Parameters

user_ids (list[str]) –

Return type

list[mattermost_api_reference_client.models.User]

async get_user(user_id)[source]#
Parameters

user_id (str) –

async get_users_statuses_by_ids(user_ids)[source]#
Parameters

user_ids (list[str]) –

Return type

list[mattermost_api_reference_client.models.Status]

async send_message_to_user(user_id, text)[source]#
Parameters
  • user_id (str) –

  • text (str) –

Return type

str

async send_message_with_file(channel_id, file_id)[source]#
Parameters
  • channel_id (str) –

  • file_id (str) –

async get_user_by_username(username)[source]#
Parameters

username (str) –

Return type

mattermost_api_reference_client.models.User

async get_direct_channel(user_id)[source]#
async get_profile_image(user_id)[source]#
Parameters

user_id (str) –

Return type

bytes

async get_file(file_id)[source]#
Parameters

file_id (str) –

async delete_post(post_id)[source]#
Parameters

post_id (str) –

async update_post(post_id, body)[source]#
Parameters
  • post_id (str) –

  • body (str) –

async get_posts_for_channel(channel_id)[source]#
Parameters

channel_id (str) –

async upload_file(channel_id, url)[source]#
Parameters
  • channel_id (str) –

  • url (str) –

async react(post_id, emoji_char)[source]#
Parameters
  • post_id (str) –

  • emoji_char (str) –

async get_reactions(post_id)[source]#
Parameters

post_id (str) –

async delete_reaction(post_id, emoji_name)[source]#
Parameters
  • post_id (str) –

  • emoji_name (str) –

async view_channel(channel_id)[source]#
Parameters

channel_id (str) –

slidge.plugins.mattermost.api.demojize(emoji_char)[source]#
Parameters

emoji_char (str) –

slidge.plugins.mattermost.api.log[source]#