Skip to content
MoonScript IRC bot
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
plugins plugins/data: Add storage for vars that should only persist with the … Jun 7, 2019
.editorconfig .editorconfig: add basic configuration Nov 22, 2016
.gitignore Add SASL, :wrap_iter, rewrite process format May 13, 2019
.vimrc .vimrc: add base vim rc file Nov 23, 2016 Create Feb 29, 2016
LICENSE README: dis now MoonScript irc bot, not Lua May 13, 2019 add options for compiling Oct 26, 2018
config.ld config.ld: add LDoc config Nov 22, 2016
logger.moon *.moon: improve async support, priorities, async typing Jun 7, 2019
logo logo: lolcat Nov 23, 2016
main.moon main: use MoonScript instead of Lua, fixes debugging May 13, 2019 MoonScript, not Lua May 13, 2019

General Information

Project Information

Moon-Moon is an IRC bot run with the Lua programming language; however, the syntax used in the development version is called 'MoonScript' - this syntax can be compiled using Leafo's MoonScript program moonc and then loaded as Lua bytecode.



LuaRocks (recommended)






Getting Started

Installing Dependencies with LuaRocks

To install rocks locally, pass the --local flag to the luarocks command. This downloads and installs rocks to a local directory without requiring access to system directories. LuaRocks is recommended to allow for easy installation of all the required software.

$ luarocks install cqueues
$ luarocks install luafilesystem
$ luarocks install moonscript # Optional


Lua is used as a configuration language; bots must each have their own separate .lua file in $XDG_CONFIG_HOME/moonmoon (which defaults to $HOME/.config).

bot "#!" {
	server = "";
	port = 6697; -- TLS is automatically set if port == 6697
	autojoin = {

The Coroutine System

Moon Moon takes advantage of a coroutine-based asynchronous system which allows the software to have multiple things "running" at once - it's almost like having a threaded program, without threads. This offers some advantages:

  1. A single Lua state
  2. Fewer callbacks
  3. Cleaner code base

Adding in a routine to the queue is simple, as demonstrated by the below examples programmed in MoonScript and Lua for convenience:


cqueues = require 'cqueues'
queue   = require 'queue'

queue\wrap ->
	while true
		cqueues.sleep 5
		print 'Hello, World!'


local cqueues = require("cqueues")
local queue   = require("queue")
	while true do
		print("Hello, World!")
You can’t perform that action at this time.