slidgram.tg_msg

Attributes

Classes

Functions

_get_link_previews(message)

_get_media(message)

Module Contents

slidgram.tg_msg.TgMediaTypes[source]
slidgram.tg_msg.MSG_POLL = '/me sent a poll but this is not supported by slidgram yet'[source]
class slidgram.tg_msg.TelegramMessageSenderMixin(*a, **kw)[source]

Bases: slidge.core.mixins.message.ContentMessageMixin

xmpp: slidgram.gateway.Gateway[source]
session: slidgram.session.Session[source]
log: logging.Logger[source]
send_file[source]

Send a single file from this XMPP Entity.

Parameters:
  • file_path – Path to the attachment

  • async_data_stream – Alternatively (and ideally) an AsyncIterator yielding bytes

  • data_stream – Alternatively, a stream of bytes (such as a File object)

  • data – Alternatively, a bytes object

  • file_url – Alternatively, a URL

  • file_name – How the file should be named.

  • content_type – MIME type, inferred from filename if not given

  • legacy_msg_id – If you want to be able to transport read markers from the gateway user to the legacy network, specify this

  • reply_to – Quote another message (XEP-0461)

  • when – when the file was sent, for a “delay” tag (XEP-0203)

  • caption – an optional text that is linked to the file

  • legacy_file_id – A unique identifier for the file on the legacy network. Plugins should try their best to provide it, to avoid duplicates.

  • thread

_convert_args[source]
property tg[source]
property contacts[source]
property bookmarks[source]
async send_tg_msg(message, carbon=False, correction=False, archive_only=False)[source]
Parameters:

message (pyrogram.types.Message)

Return type:

None

async __send_text(message, carbon=False, correction=False, archive_only=False, text=None)[source]
Parameters:
  • message (pyrogram.types.Message)

  • text (str | None)

async _send_media(message, carbon, correction=False, archive_only=False)[source]
Parameters:
  • message (pyrogram.types.Message)

  • carbon (bool)

Return type:

None

async __send_sticker(message, carbon, correction=False, archive_only=False)[source]
Parameters:
  • message (pyrogram.types.Message)

  • carbon (bool)

async _get_reply_to(message)[source]
Parameters:

message (pyrogram.types.Message | None)

Return type:

slidge.util.types.MessageReference | None

_to_message_styling(message)[source]
Parameters:

message (pyrogram.types.Message)

Return type:

str

_to_message_styling_caption(message)[source]
Parameters:

message (pyrogram.types.Message)

Return type:

str

Parameters:

message (pyrogram.types.Message)

Return type:

list[slidge.util.types.LinkPreview] | None

slidgram.tg_msg._get_media(message)[source]
Parameters:

message (pyrogram.types.Message)

Return type:

TgMediaTypes | None

slidgram.tg_msg._MEDIAS = ('audio', 'document', 'photo', 'sticker', 'animation', 'video', 'voice', 'video_note', 'new_chat_photo')[source]
slidgram.tg_msg.cpu_count[source]
slidgram.tg_msg._conversion_lock: asyncio.Lock | asyncio.Semaphore[source]