Package: mewbot-api
MewBotMewBot is an automation framework intended to simplify building cross-platform text/chat-bots.
The design is intended to be modular with configuration separated from code,
allowing users and developers to build out custom logic and behaviours with
minimal coding experience.StatusWARNING: This project is still in the very early stages.Some basic bots can be built and run, but we currently consider all parts of the framework to be unstable.Packages and ModulesThe codebase represents both the base API used to build components for the bot,
as well as an implementation of the runtime to actually execute a bot.
As such, it is built and published as a group of packages.PackageModulesDescriptionmewbotmewbotTools to load a bot, and run that bot.mewbot-coremewbot.coreBase interfaces for all modulesmewbot-apimewbot.api.v1Development libraries + component registry system. This is the package that all 3rd party libraries should depend on for their interfaces.mewbot-iomewbot.io.*The bindings to connect MewBot to a given service.mewbot-testmewbot.testsUtilities for writing tests for MewBot modules.These packages are generated by some trickery insetup.py.Each package also defines its own requirements list. Installingrequirements-dev.txtwill include all of these automatically.DevelopmentContributions to the project are made via GitHub pull requests, which will
enforce the code style and linting requirements of this project.Setting up project for local developmentThe recommended way to set this project up is using python 3.10 (or higher) with
a standardvenvsetup.
The project uses a "src-dir" layout; for Python to be able to locate the modules,
you will need to set up thePYTHONPATHenvironment variable with at least thesrc/directory.For convenience in POSIX-like systems, an importable script./tools/pathis provided that will return the appropriate path.The following example will get you started in POSIX-like shells (sh, bash, zsh, etc.).# Get the source codegitclonegit@github.com:mewler/mewbotcdmewbot# Set up the virtual environmentpython3-mvenvvenvprintf'. ./tools/path\n'>>venv/bin/activate# Activate the virtual environmentsourcevenv/bin/activate# Install all dependencies (including development dependencies)pipinstall-rrequirements-dev.txt# Run a demo!python3-mexamplesexamples/trivial_socket.yamlRunning the tests and lintersYou can run the linters via the convenience script./tools/lintor withpython -m mewbot.tools.lintThis runs the auto-formatterblack, two opinionated linting tools inflake8andpylint, and themypytype checker in strict mode.You can run the test framework using the convenience script./tools/testor withpython -m mewbot.tools.test.
Locally this will default to running all tests in parallel for fast testing.
You can add the flag--covto enable coverage, which will output coverage information
both to the terminal and store details of code coverage as webpages incoverage/.More information on the linters and tests can be found in thecontributor documentation.CREDENTIALS WARNINGPlease note.If you use you credentials for a service with mewbot, you do so at your own risk.
Some services ban accounts if they are used with bots which they determine to be harmful.
This can happen at any time and without warning.Thus we CANNOT be held responsible if you use your account credentials - whether to generate a bot token or directly -
with a mewbot bot which subsequently causes your account to be banned.This is your responsbility. Not ours.