MelisaPy is a cache-optimized Discord microframework for Python 3
Find a file
grey-cat-1908 7de8b9f12b
Merge pull request #19 from MelisaDev/dependabot/pip/orjson-3.7.8
chore(deps): bump orjson from 3.7.5 to 3.7.8
2022-07-30 15:50:14 +03:00
.github feat(guild): add list and get emoji 2022-06-27 22:43:02 +03:00
docs fix: something with emojis ya 2022-06-30 22:29:10 +03:00
melisa feat(interactions): slashcommands base 2022-07-30 15:49:46 +03:00
tests feat(CDNBuilder): add guild_member_avatar_url() method 2022-05-31 20:13:51 +03:00
.flake8 feat(interactions): add ApplicationCommandOption 2022-06-10 16:59:24 +03:00
.gitignore some requirements and tests 2022-03-18 14:57:47 +03:00
.readthedocs.yml docs, update docstrings, fix recursion 2022-03-17 21:32:43 +03:00
dev-requirements.txt chore(deps-dev): bump black from 22.3.0 to 22.6.0 2022-06-28 13:44:06 +00:00
docs-requirements.txt docs, update docstrings, fix recursion 2022-03-17 21:32:43 +03:00
LICENSE.txt some requirements and tests 2022-03-18 14:57:47 +03:00
pyproject.toml BREAKING CHANGE: cache. 2022-05-29 13:39:56 +03:00
README.md Merge pull request #7 from jungledev1/master 2022-05-28 17:32:08 +03:00
requirements.txt Create requirements.txt 2022-04-01 20:35:44 +03:00
setup.py chore(deps): bump orjson from 3.7.5 to 3.7.8 2022-07-20 13:43:24 +00:00
speed-requirements.txt chore(deps): bump orjson from 3.7.5 to 3.7.8 2022-07-20 13:43:24 +00:00

The easiest way to create your own optimized Discord Bot.


Documentation Status Repo Size GitHub last commit GitHub commit activity Discord

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.

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

NOTE: Currently, installation is only possible using GitHub

pip install git+https://github.com/MelisaDev/melisa

Events Listening

import melisa

client = 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:

import melisa

client = melisa.Client("your cool token...",
                       intents=[
                           melisa.Intents.GUILD_MEMBERS,
                           melisa.Intents.GUILD_BANS
                       ])

Or you can do something like this:

import melisa

intents = 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 interpreter

  1. 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 about contributing to the Melisa.