https://github.com/melisadev/melisa
MelisaPy is a cache-optimized Discord microframework for Python 3
https://github.com/melisadev/melisa
aiohttp alternative async asyncio caching clustering discord optimized python sharding websocket
Last synced: 7 months ago
JSON representation
MelisaPy is a cache-optimized Discord microframework for Python 3
- Host: GitHub
- URL: https://github.com/melisadev/melisa
- Owner: MelisaDev
- License: mit
- Created: 2022-03-11T17:21:35.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-17T13:41:18.000Z (about 2 years ago)
- Last Synced: 2025-03-04T05:04:27.113Z (7 months ago)
- Topics: aiohttp, alternative, async, asyncio, caching, clustering, discord, optimized, python, sharding, websocket
- Language: Python
- Homepage: https://melisa.shuoki.top/
- Size: 325 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
The easiest way to create your own optimized Discord Bot.
THIS LIBRARY IS CURRENTLY UNDER DEVELOPMENT!Every provided example or a feature is not ready or may be changed in the future
## About
MelisaPy is a Discord microframework for Python 3
for the [Discord API](https://discord.com/developers/docs/intro).It supports Discord V10 REST API and Gateway
We are trying to make our library optimized.
We are going to create really cool cache configuration, so don't worry about the RAM :)---
## Install MelisaPy### Installing from PyPi:
```commandline
pip install melisa
```
### Installing from Git:
```commandline
pip install git+https://github.com/MelisaDev/melisa
```---
## Events Listening
```python
import melisaclient = melisa.Client("your cool token...")
@client.listen
async def on_message_create(message):
if message.content.startswith('$greet'):
await message.channel.send(f'Hello man!')client.run_autosharded()
```Also, we should tell you, that logging is enabled automatically (evil laugh).
But do not worry, only some important things will be logged, but it can be disabled or changed.If you wish to specify some intents, you should do it something like that:
```python
import melisaclient = melisa.Client("your cool token...",
intents=[
melisa.Intents.GUILD_MEMBERS,
melisa.Intents.GUILD_BANS
])
```Or you can do something like this:
```python
import melisaintents = melisa.Intents.all() - melisa.Intents.GUILD_PRESENCES
client = melisa.Client("your cool token...",
intents=intents)
```Also sharding is fully supported in Melisa, but it is too long to write about it here,
so feel free to read our docs!---
## Making your bot more efficient
### Python optimization flags
You can specify some optimization flags in CPython interpreter1. `python bot.py` - no optimization
2. `python -O bot.py` - features such as internal assertions will be disabled.
3. `python -OO bot.py` - more features (including all docstrings) will be removed from the loaded code at runtime.### `melisa[speed]`
Also you can speed up some features in Melisa, like json parsing.
It will install `orjson`.---
## Want to help us?
Contributing manual is not ready yet, but will be done in some days.
Feel free to us in [our Discord Server](https://discord.gg/QX4EG8f7aD) about contributing to the Melisa.