{"id":37134813,"url":"https://github.com/lukevers/mouse","last_synced_at":"2026-01-14T15:43:42.935Z","repository":{"id":57509602,"uuid":"69798881","full_name":"lukevers/mouse","owner":"lukevers","description":"A scriptable, configuration powered IRC bot","archived":false,"fork":false,"pushed_at":"2017-01-24T14:50:15.000Z","size":4534,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T13:33:24.745Z","etag":null,"topics":["configurable","go","irc","irc-bot"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lukevers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-02T13:34:08.000Z","updated_at":"2016-11-07T13:31:35.000Z","dependencies_parsed_at":"2022-09-26T17:51:19.579Z","dependency_job_id":null,"html_url":"https://github.com/lukevers/mouse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lukevers/mouse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukevers%2Fmouse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukevers%2Fmouse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukevers%2Fmouse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukevers%2Fmouse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukevers","download_url":"https://codeload.github.com/lukevers/mouse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukevers%2Fmouse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["configurable","go","irc","irc-bot"],"created_at":"2026-01-14T15:43:42.148Z","updated_at":"2026-01-14T15:43:42.903Z","avatar_url":"https://github.com/lukevers.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Mouse](./vendor/mouse.jpg)\n\nA scriptable, configuration powered IRC bot that can handle as many connnections as you want.\n\n## Table of Contents\n\n1. [Installing](#installing)\n    1. [Building from source](#building-from-source)\n    2. [Downloading a binary](#downloading-a-binary)\n2. [Configuring](#configuring)\n    1. [Choosing a configuration type](#choosing-a-configuration-type)\n        1. [Configuring with TOML](#configuring-with-toml)\n        2. [Configuring with JSON](#configuring-with-json)\n        3. [Configuring with HCL](#configuring-with-hcl)\n        4. [Configuring with YAML](#configuring-with-yaml)\n        5. [Configuring with Java Properties](#configuring-with-java-properties)\n    2. [Configuration options](#configuration-options)\n        1. [Nick](#nick)\n        2. [User](#user)\n        3. [Name](#name)\n        4. [Host](#host)\n        5. [Port](#port)\n        6. [TLS](#tls)\n        7. [Reconnect](#reconnect)\n        8. [Ping](#ping)\n        9. [Debug](#debug)\n        10. [Channels](#channels)\n        11. [Plugins](#plugins)\n            1. [Enabled](#enabled)\n            2. [Folders](#folders)\n            3. [Pattern](#pattern)\n            4. [Events](#events)\n        12. [Storage](#storage)\n            1. [Sqlite3](#sqlite3)\n            2. [MySQL](#mysql)\n            3. [Postgres](#postgres)\n            4. [MsSQL](#mssql)\n        13. [Store](#store)\n            1. [DSN](#dsn)\n3. [API](#api)\n4. [Extending Mouse with plugins](#extending-mouse-with-plugins)\n    1. [Language choices](#language-choices)\n        1. [JavaScript](#javascript)\n        2. [Lua](#lua)\n    2. [Global functions](#global-functions)\n        1. [Join](#join)\n        2. [Part](#part)\n        3. [Cycle](#cycle)\n        4. [Say](#say)\n        5. [Kick](#kick)\n        6. [Ban](#ban)\n        7. [Unban](#unban)\n        8. [Op](#op)\n        9. [Deop](#deop)\n    3. [Global variables](#global-variables)\n        1. [Event](#event)\n            1. [Command](#command)\n            2. [Channel](#channel)\n            3. [Message](#message)\n            4. [Host](#host-1)\n            5. [Nick](#nick-1)\n            6. [User](#user-1)\n        2. [Storage](#storage-1)\n            1. [Put](#put)\n            2. [Get](#get)\n            3. [Delete](#delete)\n5. [Contributing](#contributing)\n6. [License](#license)\n\n## Installing\n\n### Building from source\n\nMouse is built on [Go](https://golang.org/), and uses [GB](https://getgb.io/) to vendor code. You should always be using the most recent version of both.\n\n```bash\ngb build all\n```\n\n### Downloading a binary\n\nThis option is currently not available, but will be once Mouse hits version `1.0.0`, and for each release after that.\n\n## Configuring\n\nYour configuration file can exist at any of the following locations:\n\n```bash\n/etc/mouse/\n$HOME/.mouse/\n./\n```\n\nThe name of your configuration file should always be `mouse`, but the file extension depends on the configuration type that you use.\n\n### Choosing a configuration type\n\nMouse uses the [Viper](https://github.com/spf13/viper) library, which allows a variety of configuration types. Your configuration file must be named appropriately and should be one of the following:\n\n```bash\nmouse.toml\nmouse.json\nmouse.hcl\nmouse.yaml\nmouse.properties\n```\n\nKeep in mind that a configuration file named `mouse.toml` MUST be a TOML file, and the same goes for every other supported configuration file type.\n\n#### Configuring with TOML\n\nYou can choose to configure Mouse with [TOML](https://github.com/toml-lang/toml). Configure your servers like this:\n\n```toml\n[servers]\n\n    [server.a]\n        nick = \"mouse\"\n\n        # ...\n\n        [servers.a.plugins.javascript]\n            enabled = true\n\n            # ...\n\n    [server.b]\n        nick = \"mouse\"\n\n        # ...\n```\n\nYou can see a full example at [contrib/config-examples/config.toml](contrib/config-examples/config.toml).\n\n### Configuring with JSON\n\nYou can choose to configure Mouse with [JSON](http://www.json.org/). Configure your servers like this:\n\n```json\n{\n    \"servers\": {\n        \"a\": {\n            \"nick\": \"mouse\",\n            \"plugins\": {\n                \"javascript\": {\n                    \"enabled\": true\n                }\n            }\n        },\n        \"b\": {\n            \"nick\": \"mouse\"\n        }\n    }\n}\n```\n\nYou can see a full example at [contrib/config-examples/config.json](contrib/config-examples/config.json).\n\n#### Configuring with HCL\n\nYou can choose to configure Mouse with [HCL](https://github.com/hashicorp/hcl). Configure your servers like this:\n\n```hcl\nservers \"a\" {\n    nick = \"mouse\"\n\n    # ...\n\n    plugins \"javascript\" {\n        enabled = true\n\n        # ...\n    }\n}\n\nservers \"b\" {\n    nick = \"mouse\"\n\n    # ...\n}\n```\n\nYou can see a full example at [contrib/config-examples/config.hcl](contrib/config-examples/config.hcl).\n\n#### Configuring with YAML\n\nYou can choose to configure Mouse with [YAML](http://yaml.org/). Configure your servers like this:\n\n```yaml\nservers:\n    a:\n        nick: mouse\n        # ...\n\n        plugins:\n            javascript:\n                enabled: true\n                # ...\n    b:\n        nick: mouse\n        # ...\n```\n\nYou can see a full example at [contrib/config-examples/config.yaml](contrib/config-examples/config.yaml).\n\n#### Configuring with Java Properties\n\nYou can choose to configure Mouse with [Java Properties](http://docs.oracle.com/javase/tutorial/essential/environment/properties.html).\n\n```properties\nservers.a.nick = \"mouse\"\n# ...\nservers.a.plugins.javascript.enabled = true\n# ...\n\nservers.b.nick = \"mouse\"\n# ...\n```\n\nYou can see a full example at [contrib/config-examples/config.properties](contrib/config-examples/config.properties).\n\n### Configuration options\n\nAll of the following configuration options should be nested in a server block. See [above](#choosing-a-configuration-type) to find a full example of the configuration file type that you're using.\n\n#### Nick\n\nNick is a string and the name that the bot will use once connected to the IRC server.\n\n```toml\nnick = \"mouse\"\n```\n\n#### User\n\nUser is a string and contains the username of the user.\n\n```toml\nuser = \"mouse\"\n```\n\n#### Name\n\nName is a string and the real name of the bot.\n\n```toml\nname = \"mouse\"\n```\n\n#### Host\n\nHost is a string that specifies what server to connect to. This should not include the port.\n\n```toml\nhost = \"irc.fc00.io\"\n```\n\n#### Port\n\nPort is an integer that specifies the port on the IRC server to connect to.\n\n```toml\nport = 6667\n```\n\n#### TLS\n\nCurrently does nothing.\n\n```toml\ntls = false\n```\n\n#### Reconnect\n\nReconnect is a boolean that when `true` will try to reconnect to the server if disconnected from.\n\n```toml\nreconnect = true\n```\n\n#### Ping\n\nPing is an integer that is the number of seconds we should ping the server for a health check.\n\n```toml\nping = 30\n```\n\n#### Debug\n\nDebug is a boolean that prints every IRC event for all connected servers to STDOUT.\n\n```toml\ndebug = false\n```\n\n#### Channels\n\nChannels is an array of strings that represent channels to join once connected to the IRC server. If the channel contains a password, it should be placed after the channel name with a space in between like `#c` is in the example below.\n\n```toml\nchannels = [ \"#a\", \"#b\", \"#c password\" ]\n```\n\n#### Plugins\n\nAll of the following configuration options should be nested in a plugins block named for the plugin language to be configured. See [below](#extending-mouse-with-plugins) for more information on plugins.\n\n##### Enabled\n\nEnabled is a boolean that enables and disables plugin support for the specific plugin language.\n\n```toml\nenabled = true\n```\n\n##### Folders\n\nFolders is an array of strings that contains a directory path for plugin files. This does not include a pattern, as the pattern attribute [below](#pattern) decides what the pattern is for plugin files. A good use of multiple folders that contain scripts could be certain scripts that only one bot should access, and some scripts that all bots should access.\n\n```toml\nfolders = [ \"/home/username/.mouse/scripts/language/\" ]\n```\n\n##### Pattern\n\nPattern is a string that contains the pattern for plugin files. This does not include the folder, as the folder attribute [above](#folder) decides where to look for the pattern.\n\n```toml\npattern = \"*.js\"\n```\n\n##### Events\n\nEvents is an array of strings that contain official IRC event types that the plugins should run on.\n\n```toml\nevents = [ \"PRIVMSG\" ]\n```\n\n#### Storage\n\nStorage is a string that contains the type of storage engine that should be used. Information of which storage enginges, along with how to find an example of a DSN, are available are below:\n\n```toml\nstorage = \"sqlite3\"\n```\n\n##### Sqlite3\n\n```\nsqlite3\n```\n\nMouse uses the [mattn/go-sqlite3](https://github.com/mattn/go-sqlite3) package for handling SQLite connections. You can find examples of DSN strings there.\n\n##### MySQL\n\n```\nmysql\n```\n\nMouse uses the [go-sql-driver/mysql](https://github.com/go-sql-driver/mysql) package for handling MySQL connections. You can find examples of DSN strings there.\n\n##### Postgres\n\n```\npostgres\n```\n\nMouse uses the [lib/pq](https://github.com/lib/pq) package for handling Postgres connections. You can find examples of DSN strings there.\n\n##### MsSQL\n\n```\nmssql\n```\n\nMouse uses the [denisenkom/go-mssqldb](https://github.com/denisenkom/go-mssqldb) package for handling MsSQL connections. You can find examples of DSN strings there.\n\n#### Store\n\nAll of the following configuration options should be nested in a store block named for the storage engine to be configured.\n\n##### DSN\n\nDSN is a string that contains the data source name that should be used to connect to this specific storage engine.\n\n```toml\ndsn = \"mouse.db\"\n```\n\n## API\n\nSee the API on [GoDoc](https://godoc.org/github.com/lukevers/mouse/src/mouse) for the most up to date documentation.\n\n## Extending Mouse with plugins\n\n### Language choices\n\n#### JavaScript\n\nUsing the embeddable JavaScript interpreter [Otto](https://github.com/robertkrimen/otto), we can write plugins that deeply integrate with Mouse.\n\n#### Lua\n\nComing soon.\n\n### Global functions\n\n#### Join\n\nThe `join` function allows your bot to join a new channel. You may also specify a password if the channel has a password set, but that's not required. If there is a password, append it to the channel parameter with a space in between.\n\n```javascript\n/**\n * @param string channel\n */\nfunction join(channel)\n```\n\n#### Part\n\nThe `part` function allows your bot to part a channel.\n\n```javascript\n/**\n * @param string channel\n */\nfunction part(channel)\n```\n\n#### Cycle\n\nThe `cycle` function allows your bot to cycle on a channel. This will leave the channel, and then re-join it.\n\n```javascript\n/**\n * @param string channel\n */\nfunction cycle(channel)\n```\n\n#### Say\n\nThe `say` function allows your bot to send messages to any buffer that will allow it. When sending to a channel, the channel name must be prefixed with `#`, and when sending to a user, it should not be.\n\n```javascript\n/**\n * @param string buffer\n * @param string message\n */\nfunction say(buffer, message)\n```\n\n#### Kick\n\nThe `kick` function allows your bot to kick users out of a channel. You may also specify a reason, but that's not required.\n\n```javascript\n/**\n * @param string channel\n * @param string user\n * @param string reason\n */\nfunction kick(channel, user, reason)\n```\n\n#### Ban\n\nThe `ban` function allows your bot to ban users in a channel. You may also specify a reason, but that's not required.\n\n```javascript\n/**\n * @param string channel\n * @param string user\n * @param string reason\n */\nfunction ban(channel, user, reason)\n```\n\n#### Unban\n\nThe `unban` function allows your bot to unban users in a channel.\n\n```javascript\n/**\n * @param string channel\n * @param string user\n */\nfunction unban(channel, user)\n```\n\n#### Op\n\nThe `op` function allows your bot to change the mode of a user to `+o` in a channel.\n\n```javascript\n/**\n * @param string channel\n * @param string user\n */\nfunction op(channel, user)\n```\n\n#### Deop\n\nThe `deop` function allows your bot to change the mode of a user to `-o` in a channel.\n\n```javascript\n/**\n * @param string channel\n * @param string user\n */\nfunction deop(channel, user)\n```\n\n### Global variables\n\nThere are variables set at the global scope that can be used in all plugins.\n\n#### Event\n\nOn each event that the plugins are listening for, a new event is populated that is passed in to an `event` object in the global scope.\n\n##### Command\n\nCommand is a string that contains the command that triggered this event. The most frequently used command in Mouse plugins is probably [`\"PRIVMSG\"`](https://tools.ietf.org/html/rfc2812#section-3.3.1).\n\n```javascript\nevent.command\n```\n\n##### Channel\n\nChannel is a string that contains the channel where the event took place. Channel is not just for channels, but also for private messages. If it is a channel, it will be prefixed with `#`.\n\n```javascript\nevent.channel\n```\n\n##### Message\n\nMessage is a string that contains the message of the event.\n\n```javascript\nevent.message\n```\n\n##### Host\n\nHost is a string that contains the host of the user that triggered this event.\n\n```javascript\nevent.host\n```\n\n##### Nick\n\nNick is a string that contains the nick of the user that triggered this event.\n\n```javascript\nevent.nick\n```\n\n##### User\n\nUser is a string that contains the user of the user that triggered this event.\n\n```javascript\nevent.user\n```\n\n#### Storage\n\nThe `storage` object at the global scope cotains key functionality for using a database with plugins.\n\n##### Put\n\nThe `storage.put` function allows your bot to save a key and value to a database. If the key does not exist, it will be created. If the key does exist, it will overwritten.\n\n```javascript\n/**\n * @param string key\n * @param string val\n */\nfunction put(key, val)\n```\n\n##### Get\n\nThe `storage.get` function allows your bot to get a value from a database from a key.\n\n```javascript\n/**\n * @param string key\n */\nfunction get(key)\n```\n\n##### Delete\n\nThe `storage.delete` function allows your bot to delete a row from a database with a key.\n\n```javascript\n/**\n * @param string key\n */\nfunction delete(key)\n```\n\n## Contributing\n\nWant to contribute? Do it. Read the [contributing guidelines](CONTRIBUTING.md) first.\n\n## License\n\nMouse is licensed under [MIT](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukevers%2Fmouse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukevers%2Fmouse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukevers%2Fmouse/lists"}