ParsMeet Library Guide (Version 1.3.0)
Install the library:
pip install ParsMeet
Create a bot:
import ParsMeet
bot = ParsMeet.Bot(token="Your bot token", ai_key="AI key (optional)")
Send a message:
bot.send_message(chat_id, "Message text")
Send a message with a glass button:
btn1 = bot.create_callback("Button 1", "btn1")
btn2 = bot.create_callback("Button 2", "btn2")
bot.send_message(chat_id, "Text", reply_markup={"inline_keyboard": [[btn1], [btn2]]})
Send a photo:
bot.send_photo(chat_id, "Photo address or link", caption="Image description")
Send file:
bot.send_document(chat_id, "file_address", caption="file_description")
Reply to message:
bot.reply_message(chat_id, message_id, "reply text")
Edit message:
bot.edit_message(chat_id, message_id, "new text")
Delete message:
bot.delete_message(chat_id, message_id)
Receive messages:
@bot.on_message_all()
def handler(data):
chat_id = data["chat_id"]
text = data["text"]
username = data["username"]
Receive button clicks:
@bot.on_callback_query()
def handler(data):
chat_id = data["chat_id"]
callback_data = data["data"]
Group management (optional):
bot.ban_user(chat_id, user_id)
bot.unban_user(chat_id, user_id)
bot.promote_user(chat_id, user_id)
bot.demote_user(chat_id, user_id)
bot.pin_message(chat_id, message_id)
Connect to AI:
response = bot.ask_ai("Your question")
bot.send_message(chat_id, response)
Send to all:
bot.broadcast("Message text for everyone")
Run the bot:
bot.run()
Shut down the bot (from the console):
bot.off()
Full example (bot simple):
import ParsMeet
bot = ParsMeet.Bot(token="Your bot token")
@bot.on_message_all()
def handler(data):
chat_id = data["chat_id"]
text = data["text"]
if text == "/start":
btn = bot.create_callback("Menu", "menu")
bot.send_message(chat_id, "Hello, welcome", reply_markup={"inline_keyboard": [[btn]]})
elif text == "/help":
bot.send_message(chat_id, "Commands: /start and /help")
bot.run()
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parsmeet-1.3.0.tar.gz.
File metadata
- Download URL: parsmeet-1.3.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f56d19163bd591482d0f02d6fe0f4b87f6de9ca3807da1364b9cd801f74029a
|
|
| MD5 |
dfc8ac99244f0cb8c51ec7e9419bd692
|
|
| BLAKE2b-256 |
3febd44bc400d81e41d9175add92263aa83a813c6759bfd9168382eeccd90131
|
File details
Details for the file parsmeet-1.3.0-py3-none-any.whl.
File metadata
- Download URL: parsmeet-1.3.0-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a65ac9ab26879e7c744de7648258ebe866aa8bacfc123b1bf1488e2bea9f645
|
|
| MD5 |
01284aec2a86c24a93684b2cc4e4300d
|
|
| BLAKE2b-256 |
813a28f6dbfe1ce63d3b708505bf663324824a19b0b234e64b1308c6c454764e
|