No project description provided
Project description
Eitaa Pykit
Toolkit for Eitaa messenger.
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 successfullyFalse
: 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
insend_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 successfullyFalse
: 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
Built Distributions
File details
Details for the file eitaa_pykit-1.2.1.tar.gz
.
File metadata
- Download URL: eitaa_pykit-1.2.1.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f6ad1285f8ce5743943af9a3026b22e71549fe13c9b849cdd4312f2504380e1 |
|
MD5 | d1d828b78e5c09e4fd6edab082b3f14e |
|
BLAKE2b-256 | 94b0b771c4d96bbf56ac0496e3f382e1f55d1e7499639af6c04631140faa26ce |
File details
Details for the file eitaa_pykit-1.2.1-py3.8.egg
.
File metadata
- Download URL: eitaa_pykit-1.2.1-py3.8.egg
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 169cf082835561e4c57cd9abe7539ad61a59a9ea1182c8761c0e098d5f8eaf57 |
|
MD5 | 61c8c9cd7ada4754aa03d24cc54a15d9 |
|
BLAKE2b-256 | eb203491a29b71659a534018d096759c7ae05dbbc5996a402cc6c3452fb57341 |
File details
Details for the file eitaa_pykit-1.2.1-py3-none-any.whl
.
File metadata
- Download URL: eitaa_pykit-1.2.1-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 923cf0206ff16431a81b1d7b8c3a385883d87dede503ceba3acd3ecdc17d7e09 |
|
MD5 | f41f60be34b36b6e1e7d19ff2f60365d |
|
BLAKE2b-256 | 56ff6d17c8759f6490a00a9e90003bba6cba976eb1a1ebc40c10edb448e31b86 |