{"id":16132272,"url":"https://github.com/luk3yx/lurklite","last_synced_at":"2025-03-18T14:31:33.791Z","repository":{"id":62577161,"uuid":"164965387","full_name":"luk3yx/lurklite","owner":"luk3yx","description":"The IRC bot lurklite (excluding commands).","archived":false,"fork":false,"pushed_at":"2023-04-22T23:27:43.000Z","size":134,"stargazers_count":7,"open_issues_count":1,"forks_count":3,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-28T10:18:25.511Z","etag":null,"topics":["bot","discord-bot","irc-bot","miniirc"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luk3yx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-10T01:16:33.000Z","updated_at":"2024-06-18T19:04:35.000Z","dependencies_parsed_at":"2024-10-27T18:20:42.001Z","dependency_job_id":null,"html_url":"https://github.com/luk3yx/lurklite","commit_stats":{"total_commits":78,"total_committers":1,"mean_commits":78.0,"dds":0.0,"last_synced_commit":"b3def2ad7cfbcf53b981775f4a4a415da0d2dd48"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Flurklite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Flurklite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Flurklite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Flurklite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luk3yx","download_url":"https://codeload.github.com/luk3yx/lurklite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933439,"owners_count":20370986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bot","discord-bot","irc-bot","miniirc"],"created_at":"2024-10-09T22:29:36.211Z","updated_at":"2025-03-18T14:31:33.500Z","avatar_url":"https://github.com/luk3yx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003e\n        \u003cimg src=\"./lurklite.png\"\n            width=\"128\" alt=\" \" /\u003e\n        \u003cbr/\u003e\n        lurklite\n    \u003c/h1\u003e\n\u003c/div\u003e\n\n![Python 3.6+] [![Available on PyPI.]](https://pypi.org/project/lurklite/) [![License: AGPLv3]](https://github.com/luk3yx/miniirc/blob/master/LICENSE.md)\n\n[Python 3.6+]: https://img.shields.io/badge/python-3.6+-blue.svg\n[Available on PyPI.]: https://img.shields.io/pypi/v/lurklite.svg\n[License: AGPLv3]: https://img.shields.io/pypi/l/lurklite.svg\n\nluk3yx's \"lightweight™\" IRC and Discord bot (excluding commands).\n\n## Official bot\n\nIf you can't or don't want to run your own bot, you can request that the\nofficial bot be added to your channel. The official bot is on a few IRC\nnetworks, most notably Libera Chat and xeroxIRC. PM `luk3yx` there if you want\nthe bot on an IRC channel you own. *Note that this IRC bot is running\n[Sopel](https://github.com/sopel-irc/sopel) and not lurklite, hopefully I'll\nrelease the API shim it uses sometime.*\n\nAlternatively, if you use Discord, you can use [https://bit.ly/lurkdiscord] to\nadd lurklite (without any permissions) to your Discord guild/server.\n\n[https://bit.ly/lurkdiscord]: https://discordapp.com/oauth2/authorize?\u0026client_id=525031486047387648\u0026scope=bot\u0026permissions=0\n\n## Installation\n\nTo install lurklite, you can simply install it with `pipx install lurklite`.\nAfter installation, you should be able to run `lurklite`.\n\n## Config file\n\nThe lurklite config file has a format similar to `ini` files. It must have a\n`[core]` section with the following values:\n\n```ini\n[core]\n# The tempcmd db, commands added with .tempcmd are stored here.\n# If you have msgpack installed, this database will be slightly smaller and\n#   faster to read/write to/from.\ncommand_db = /path/to/tempcmd/database\n\n# The bot's command prefix.\nprefix     = .\n\n# (Optional) A list of hostmasks to ignore.\n# ignored  = *!*@*/bot/*, baduser!*@*\n\n# (Optional) Disable \"Yay!\" and \"Ouch.\" replies.\n# disable_yay  = false\n# disable_ouch = false\n```\n\n### Connecting to IRC servers\n\nYou can then create sections starting with `irc.` (for example `irc.mynetwork`)\nto connect to IRC servers:\n\n```ini\n[irc.mynetwork]\nip   = irc.example.com\nport = 6697\nnick = testbot\nchannels = #botwar,#other-channel\n\n# List of hostmasks to ignore (optional)\n# ignored = *!*@*/bot/*, *!*sopel*@*\n\n# List of hostnames for admins\n# admins = unaffiliated/user\n```\n\nThe following optional values may be added to the above config, and are sent\ndirectly to [miniirc]:\n\n```ini\nconnect_modes = +g\nident         = ident\nns_identity   = username password\nquit_message  = Quit message\nrealname      = realname\nssl           = true\n```\n\n### Connecting to Matrix servers\n\nYou can connect to Matrix (using [miniirc_matrix]) with this config section:\n\n```ini\n[matrix]\nhomeserver = example.com\ntoken = your-matrix-token\nadmins = @yourusername:example.com\n```\n\nObtaining a token is currently not very straightforward. You can use the\nfollowing Python code. Note that if you execute this in an interactive Python\nshell it will likely save both the username and password in its history file.\n\n```py\nimport miniirc_matrix\nprint(miniirc_matrix.login('example.com', 'botusername', 'password'))\n```\n\nThe bot will automatically accept invites from admins.\n\n### Connecting to Discord servers\n\nYou can also connect to Discord servers (via [miniirc_discord]) with the\nfollowing config section:\n\n```ini\n[discord]\n# You need miniirc_discord installed for this to work.\ntoken    = your-discord-token\n\n# Using user IDs instead of username#discriminator improves security.\n# admins = username#1234, userid\n```\n\nYou can only have one Discord connection per bot process, and lurklite will use\nslightly more RAM if `[discord]` exists, as [miniirc_discord] will be imported\n(and if you don't specify a Discord bot token, [miniirc_discord] won't be\nimported).\n\n### Storing the command database in an ASCII-safe format.\n\nIf you have the habit of opening and modifying `commands.db` in a text editor,\nit might be a good idea to store it with JSON by adding the following to your\nconfiguration file:\n\n```ini\n[tempcmds]\ndb_format = json\n```\n\n*Note that this will very slightly degrade performance and increase the size,\nhowever this should be a negligible amount for most purposes.*\n\n## Creating commands\n\nOnce your bot has connected to IRC (or Discord), you can use `tempcmd` to\ncreate (permanent) commands. You can either do\n`.tempcmd \u003ccommand\u003e \u003ctype\u003e \u003ccode\u003e` to add a tempcmd with a set type, or\n`.tempcmd \u003ccommand\u003e \u003ccode\u003e` to auto-detect the type (as long as the first word\nin `\u003ccode\u003e` is not a valid type).\n\n*For now, tempcmds.py has a list of code types/formats and what they do.*\n\nTo delete commands, you can use `tempcmd del/delete/remove \u003ccommand\u003e`. To create\na command called `del`, `delete` or `remove`, you can prepend your bot's prefix\nto the command name.\n\n### Creating non-\"tempcmd\" commands\n\nIf you want more fine-grained control over a command, you can add a\n`custom_cmds` line to the `[core]` section of config.ini. The file specified\nwill be loaded and can define more powerful commands, for example:\n\n```py\n# A simple version command\n# The \"requires_admin\" parameter is optional and defaults to False.\n@register_command('version', requires_admin=False)\ndef version_command(irc, hostmask, is_admin, args):\n    # irc: The miniirc.IRC (or miniirc_discord.Discord) object.\n    # hostmask: The hostmask tuple, mostly from miniirc. Note that relayed\n    #   messages (for example \"\u003crelayed_user\u003e test\") will have a hostmask\n    #   similar to ('relayed_user@relay_bot', 'relay_bot_ident',\n    #       'relay.bot.host/relayed/relayed_user').\n    # is_admin: Either `False` or a string with the admin match (for example\n    #   a hostmask or Discord tag.\n    # args: [\"#channel\", \"command parameters\"]\n    #   For PMs, \"#channel\" will be the sender (hostmask[0]).\n\n    irc.msg(args[0], miniirc.version)\n```\n\n*You do not have to import anything to get `register_command`.*\n\nIf `custom_cmds` is a directory, all `.py` files in that directory will be\nloaded. If you want your custom commands file/directory in lurklite's source\ndirectory, you can name it `custom_cmds.py` (or, for directories, `custom_cmds`\nor `commands`) to make `git` ignore it.\n\n## Built-in commands\n\nlurklite has the following built-in commands:\n\n - `reboot`: Reboot the bot.\n - `tempcmd`: Create and delete commands.\n - `version`: Display the miniirc version and quit.\n\n## Migrating from very old versions of lurklite\n\nOlder versions of lurklite (pre-v0.1.0) had a `tempcmds.db` created using\n`repr()`. This is slow(-ish) and inefficient, so is no longer supported. If you\nstill have a pre-v0.1.0 `tempcmds.db`, you can run\n`tempcmds_migrate.py` to update it to the new msgpack/JSON format.\n\n[miniirc]: https://github.com/luk3yx/miniirc\n[miniirc_matrix]: https://github.com/luk3yx/miniirc_matrix\n[miniirc_discord]: https://github.com/luk3yx/miniirc_discord\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluk3yx%2Flurklite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluk3yx%2Flurklite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluk3yx%2Flurklite/lists"}