Skip to content

LXMFy Bot Framework

Current Version: 0.7.7

Github | Road to V1

Easily create LXMF bots for the Reticulum Network with this framework.

Terminal window
pip install lxmfy
Pipx Install
Terminal window
pipx install lxmfy
uv Install
Terminal window
uv venv
uv pip install lxmfy
Terminal window
lxmfy create
lxmfy create mybot
lxmfy create --template echo mybot
lxmfy create --template reminder bot
lxmfy create --template note notes
lxmfy create --template cogtest test
lxmfy run echo
lxmfy run reminder --name "MyReminder"
lxmfy run note
lxmfy run cogtest
FeatureDescription
First Message HandlerCustom welcome messages for new users
Storage OptionsSQLite or JSON storage
Permission SystemRole-based access control with hierarchical permissions
Hot ReloadingCog system for modular bot development
ModerationBuilt-in commands for user management
Help SystemAutomatic command documentation and help
Spam ProtectionRate limiting and protection
Transport LayerPath discovery and caching
Project NameDescriptionAuthor
Ollama BotQuery LLM modelslxmfy
Weather BotOpenWeatherMap Botlxmfy
JS8Call BotReceive JS8Call messageslxmfy
News BotGet your daily news feeds!lxmfy
HA ConversationsHome Assistant integrationmetrafonic
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 cogs
load_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()