Skip to main content

No project description provided

Project description

Eitaa Pykit

Toolkit for Eitaa messenger.

Pypi Downloads

NOTE : for send message to chats you should add @sender as manager to your chat.

Install via pip

Windows:

pip install eitaapykit

Linux:

pip3 install eitaapykit

Eitaa class

First create an object from Eitaa class :

from eitaa import Eitaa
eitaa_obj = Eitaa("your eitaayar.ir token")

The methods call from this class.

Get information of a channel

For get information of a channel you can use get_info function in Eitaa class.

params :

  • channel_id: channel id to get information(without @)

NOTE: This method is a static method and you can call it without creating any object from Eitaa.

Example :

print(eitaa_obj.get_info("channel ID"))
# or :
print(Eitaa.get_info("channel ID"))

It returns a dict object contains channel's name, image's url, subscribers count and channel's description.

{
  "name": "channel name",
  "image_url": "channel image url",
  "users" : "subscribers count",
  "desc" : "description of channel",
}

Send a message

For send a meesage to your channel/group you can usesend_message function in Eitaa class.

params :

  • chat_id : your chat id(if your chat is a channel set it to channel id/invite link, and if your chat is a group set it to your group's invite link)
  • text : text to send
  • pin(optional) : if you want to message pinned in chat, set it True
  • view_delete(optional) : if views of your post be equal to view_delete, message will delete

Example :

print(eitaa_obj.send_message("chat id","message text",pin=1)

It returns a bool value that shows send status :

  • True : message sent successfully
  • False : error in sending message

Send a file

For send a file to your channel you can usesend_file function in Eitaa class.

params :

  • chat_id : your chat id(if your chat is a channel set it to channel id/invite link, and if your chat is a group set it to group invite link)
  • caption : caption of your file(similar to text in send_message function)
  • file : your file name to send to chat
  • pin(optional) : if you want to file pinned in chat, set it True
  • view_delete(optional) : if views of your post be equal to view_delete, file will delete

Example :

print(eitaa_obj.send_file("chat id","caption","README.txt",pin=1)

It returns a bool value that shows send status :

  • True : file sent successfully
  • False : error in sending message

Todo

  • Better error handler on Eitaa.send_*
  • More options with selenium.

About

This project is licensed under the MIT License, for more information read License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eitaa_pykit-1.2.1.tar.gz (3.7 kB view hashes)

Uploaded source

Built Distribution

eitaa_pykit-1.2.1-py3-none-any.whl (3.8 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page