LXMFy Bot Framework
Current Version: 0.7.7
Easily create LXMF bots for the Reticulum Network with this framework.
pip install lxmfy
Pipx Install
pipx install lxmfy
uv Install
uv venvuv pip install lxmfy
Commands
Section titled “Commands”lxmfy createlxmfy create mybotlxmfy create --template echo mybotlxmfy create --template reminder botlxmfy create --template note noteslxmfy create --template cogtest testlxmfy run echolxmfy run reminder --name "MyReminder"lxmfy run notelxmfy run cogtest
Features
Section titled “Features”Feature | Description |
---|---|
First Message Handler | Custom welcome messages for new users |
Storage Options | SQLite or JSON storage |
Permission System | Role-based access control with hierarchical permissions |
Hot Reloading | Cog system for modular bot development |
Moderation | Built-in commands for user management |
Help System | Automatic command documentation and help |
Spam Protection | Rate limiting and protection |
Transport Layer | Path discovery and caching |
Bots Created with LXMFy
Section titled “Bots Created with LXMFy”Project Name | Description | Author |
---|---|---|
Ollama Bot | Query LLM models | lxmfy |
Weather Bot | OpenWeatherMap Bot | lxmfy |
JS8Call Bot | Receive JS8Call messages | lxmfy |
News Bot | Get your daily news feeds! | lxmfy |
HA Conversations | Home Assistant integration | metrafonic |
Example
Section titled “Example”from lxmfy import LXMFBot, load_cogs_from_directory
bot = LXMFBot( name="LXMFy Test Bot", # Name of the bot that appears on the network. announce=600, # Announce every 600 seconds, set to 0 to disable. announce_enabled=True, # Set to False to disable all announces (both initial and periodic) announce_immediately=True, # Set to False to disable initial announce admins=["your_lxmf_hash_here"], # List of admin hashes. hot_reloading=True, # Enable hot reloading. command_prefix="/", # Set to None to process all messages as commands. cogs_dir="cogs", # Specify cogs directory name. rate_limit=5, # 5 messages per minute cooldown=5, # 5 seconds cooldown max_warnings=3, # 3 warnings before ban warning_timeout=300, # Warnings reset after 5 minutes)
# Dynamically load all cogsload_cogs_from_directory(bot)
@bot.command(name="ping", description="Test if bot is responsive")def ping(ctx): ctx.reply("Pong!")
# Admin Only Command@bot.command(name="echo", description="Echo a message", admin_only=True)def echo(ctx, message: str): ctx.reply(message)
bot.run()