Skip to content

Hana-Works/luna

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Luna

Luna is a Go library that makes it easy to build custom Facebook Messenger clients. It's a simplified wrapper around the mautrix-meta messagix library, handling all the messy details of Meta's reverse-engineered protocols so you can focus on building your app.

Getting Started

To see Luna in action, you can run the included CLI tool:

# Build the example
go build -o luna-cli ./cmd/luna

# Run it
./luna-cli

The first time you run it, it'll walk you through a native login flow (just like the Messenger Lite app). It saves your session to luna.db so you don't have to log in every time.

Key Features

  • Native Login: Log in with just your username and password. No need to hunt for browser cookies. Note: Two-Factor Authentication (2FA) must be enabled on your account for this method to work.
  • Persistence: Sessions are automatically managed and stored in SQLite.
  • Simple Events: Hook into messages, reactions, and connection status changes with a single callback.
  • Clean API: We've abstracted away the "LightSpeed" tables and MQTT complexity into a clean, Go-idiomatic interface.

How it works

Under the hood, Luna uses pkg/messagix to talk to Meta's servers. This involves emulating a Messenger Lite device, interpreting "Bloks" scripts (Meta's server-driven UI), and maintaining a persistent MQTT connection for real-time updates. Luna takes all those moving parts and provides a stable Client interface.

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages