kutana.backends package

Module contents

class kutana.backends.Debug(messages=None, on_complete=None, save_replies=True)

Bases: kutana.backend.Backend

perform_send(target_id, message, attachments, kwargs)
perform_updates_request(submit_update)
class kutana.backends.Vkontakte(token, session=None, requests_per_second=19, longpoll_settings=None, api_version='5.103', api_url='https://api.vk.com')

Bases: kutana.backend.Backend

on_shutdown(app)
on_start(app)
perform_api_call(method, kwargs)
perform_send(target_id, message, attachments, kwargs)
perform_updates_request(submit_update)
prepare_context(ctx)
raw_request(method, kwargs={})

Call specified method from VKontakte api with specified kwargs and return response’s data.

This method raises RequestException if response contains error.

request(method, _timeout=None, **kwargs)

Call specified method from VKontakte api with specified kwargs and return response’s data.

This method respects limits.

This method raises RequestException if response contains error.

resolve_screen_name(screen_name)
send_message(target_id, message, attachments=(), **kwargs)

Send message to specified target_id with text message and attachments attachments.

This method will forward all excessive keyword arguments to sending method.

update_longpoll_data()
upload_attachment(attachment, peer_id=None)

Upload specified attachment to VKontakte with specified peer_id and return newly uploaded attachment.

This method doesn’t change passed attachments.

class kutana.backends.Telegram(token, messages_per_second=29, session=None, proxy=None, api_url='https://api.telegram.org')

Bases: kutana.backend.Backend

on_shutdown(app)
on_start(app)
perform_api_call(method, kwargs)
perform_send(target_id, message, attachments, kwargs)
perform_updates_request(submit_update)
request(method, **kwargs)

Call specified method from Telegram api with specified kwargs and return response’s data.

send_message(target_id, message, attachments=(), **kwargs)

Send message to specified target_id with text message and attachments attachments.

This method will forward all excessive keyword arguments to sending method.

class kutana.backends.Terminal

Bases: kutana.backend.Backend

perform_send(target_id, message, attachments, kwargs)
perform_updates_request(submit_update)