High-level Python interface for Simplex API
Project description
python-simplex-bot
A high-level python library for building bots for simplex chat
Currently supported simplex-chat version: 6.3.6.0
Installation
pip install python-simplex-bot
Alternatively, clone this repository into a desired location
Usage
Creating your first bot
- Install simplex-chat terminal client
- Start client using
simplex-chat -p 5225 -d my-bot-name - If running for the first time, answer the initial questions e.g. username (this will be your bot's name as users see it)
- Save this code as
bot.py:from simplex_bot import Bot from sumplex_bot.types import UpdateNewContact, UpdateTextMessage, BaseContext # 5225 is the port number you passed to the -p argument in step 2: bot = Bot(url="ws://localhost:5225") @bot.hello_handler async def hello_handler(update: UpdateNewContact, context: BaseContext): await context.reply(f"Hello, {update.peer.user.username}!") @bot.text_handler async def echo_handler(update: UpdateTextMessage, context: BaseContext): await context.reply(f"You said: {update.text}) bot.start()
- Run your bot with
python3 bot.py - Bot will print its address into the terminal output. Insert this address into your favourite simplex chat client application to connect to your bot.
Example bots
Love to learn by example? See ./examples/ directory for some self-explanatory examples
Documentation
See ./docs/README.md for detailed documentation and reference.
PyDoc is also available; access it from your IDE, pydoc server or python console e.g.:
>>> import simplex_bot
>>> help(simplex_bot)
Roadmap
v0.1 milestone:
- Automatically message a new contact
- Send and receive text messages
- Send and receive multimedia messages
- File transfers
- Edit and delete messages
- Message statuses (mark as read/fire when user has read)
- Reply to messages
v0.2 milestone:
- Group chat operations - [ ] Create one-time group invite link - [ ] User joined/user left events - [ ] Mute/unmute - [ ] Kick user from group - [ ] Manage group chat preferences
v0.3 milestone:
- Dialog state management using the
contextobject
v0.4 milestone:
- Profile management - [ ] Set username and profile photo - [ ] Generate one-time links
- Multi user support (run multiple bots using single websocket connection)
- List connected users and groups
Contacts
For bug reports and feature requests, use Issues.
Donations
Toss a coin to your developer, o Valley of Plenty
- Bitcoin: ``
- Bitcoin Cash: ``
- Litecoin: ``
- Ethereum/ERC-20: ``
- Tron/TRC-20: ``
- Solana: ``
- Monero: ``
Project details
Release history Release notifications | RSS feed
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 python_simplex_bot-0.0.1.tar.gz.
File metadata
- Download URL: python_simplex_bot-0.0.1.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21b80ecfddbc4a57eb9d4f90d0fb4b02580f2a9ef218dc1f67aabe2146db4eb9
|
|
| MD5 |
e49fe567a427090becc86353fe905d82
|
|
| BLAKE2b-256 |
4a1b2b9c80de8c38bf9caff3397ecd95bf70e4854868080fcc42a722c2a90339
|
File details
Details for the file python_simplex_bot-0.0.1-py3-none-any.whl.
File metadata
- Download URL: python_simplex_bot-0.0.1-py3-none-any.whl
- Upload date:
- Size: 18.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5f9a13631c969468434a5df528dd9e5c7c7871e3e4c0e0fdb2a33578404d39f
|
|
| MD5 |
fe137ba29d138acf9be16ced62706390
|
|
| BLAKE2b-256 |
af885c105450d6bfb22cf752676937d9d5bb4b7da6c5a7c0f0275a1a3588b775
|