{"id":16132304,"url":"https://github.com/luk3yx/miniirc_discord","last_synced_at":"2025-04-15T15:11:51.718Z","repository":{"id":38737160,"uuid":"162505087","full_name":"luk3yx/miniirc_discord","owner":"luk3yx","description":"A Discord wrapper for miniirc.","archived":false,"fork":false,"pushed_at":"2023-06-23T07:40:53.000Z","size":45,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T15:11:48.801Z","etag":null,"topics":["discord","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luk3yx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-12-20T00:20:19.000Z","updated_at":"2023-06-26T02:00:55.000Z","dependencies_parsed_at":"2024-11-01T10:41:49.418Z","dependency_job_id":"0595777c-5d1d-4998-a3fe-abd589f5ab20","html_url":"https://github.com/luk3yx/miniirc_discord","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Fminiirc_discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Fminiirc_discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Fminiirc_discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luk3yx%2Fminiirc_discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luk3yx","download_url":"https://codeload.github.com/luk3yx/miniirc_discord/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249094932,"owners_count":21211837,"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":["discord","miniirc"],"created_at":"2024-10-09T22:29:43.003Z","updated_at":"2025-04-15T15:11:51.680Z","avatar_url":"https://github.com/luk3yx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# miniirc_discord\n\n[![Available on PyPI.](https://img.shields.io/pypi/v/miniirc-discord.svg)](https://pypi.org/project/miniirc-discord/)\n\nA wrapper for miniirc ([GitHub], [GitLab]) to allow bots or clients made in\nminiirc to connect to (proprietary) [Discord] servers via [discord.py] with\nminimal code changes.\n\n## How to use\n\nTo use miniirc_discord, you already need to know how to use miniirc ([GitHub],\n[GitLab]). Instead of creating a `miniirc.IRC` object, however, you need to\nuse `miniirc_discord.Discord`. This is very similar, however has some\ndifferences:\n\n - `miniirc_discord.Discord` objects are created with\n   `miniirc_discord.Discord('TOKEN')`.\n - There is a [`stateless_mode` keyword argument](#stateless-mode).\n - The `discord_client` attribute returns an instance of `discord.Client`, or\n    `None` if stateless_mode is enabled.\n - There is a `get_server_count()` method which returns the number of guilds\n    the bot is in.\n\nChannels will start in `#` if they are public and are currently just a channel\nID.\n\nSome formatting from IRC to Discord should be translated nicely, however\nmore complex codes and formatting from Discord to IRC are currently not.\n\nYour bot will need to be able to request the \"message content\" intent for\nminiirc_discord to work properly.\n\n### Stateless mode\n\nThe `stateless_mode` keyword argument will instruct discord.py to disable the\nuser cache and any intents not required by miniirc_discord. This should be\nenabled if you are not using `discord_client` to cut back on memory and\nbandwidth usage.\n\nSince miniirc_discord 0.6.0, the stateless_mode keyword argument is `True` by\ndefault.\n\n### Example\n\n```py\nTOKEN = os.environ['DISCORD_TOKEN']\n\nirc = miniirc_discord.Discord(TOKEN)\nchannel = irc.discord_client.get_channel(channel_id)  # Error!\n\n# Disabling stateless mode will add a \"discord_client\" attribute\nirc = miniirc_discord.Discord(TOKEN, stateless_mode=False)\nchannel = irc.discord_client.get_channel(channel_id)  # No error\n```\n\n## Supported commands\n\n### `PRIVMSG`\n\n`PRIVMSG` operates like you'd expect and IRC formatting codes are converted to\nmarkdown. You can use the `+draft/reply` IRCv3 tag to reply to a message.\n\n### `CTCP ACTION` (`irc.me()`)\n\nThis works similarly to `PRIVMSG`, except the CTCP ACTION is also converted to\na Discord `/me`.\n\n### `NOTICE`\n\n`NOTICE`s are converted into embeds by miniirc_discord. To set an embed title,\nyou can add a bold line to the start of the embed:\n\n```py\nirc.notice(channel, '\\x02Embed title\\x02\\nEmbed content')\n```\n\nYou can add an\n[IRC colour code](https://modern.ircdocs.horse/formatting.html#colors)\nto the start of the line to set the embed colour:\n\n```py\n# Green embed\nirc.notice(channel, '\\x033\\x02Embed title\\x02\\x03\\nEmbed content')\n\n# Light blue embed\nirc.notice(channel, '\\x0312\\x02Embed title\\x02\\x03\\nEmbed content')\n```\n\nOlder versions of miniirc_discord had a non-standard IRCv3 tag to set the embed\ntitle. This is still supported, however you should switch to the above syntax\nwhen possible.\n\n### `TAGMSG`\n\nYou can add reactions to messages using the `+draft/react` message tag.\n\nExample:\n\n```py\n@irc.Handler('PRIVMSG', colon=False, ircv3=True)\ndef handle_privmsg(irc, hostmask, tags, args):\n    if args[1] == '$react':\n        irc.send('TAGMSG', args[0], tags={\n            '+draft/reply': tags.get('msgid'),\n            '+draft/react': '🆗️'\n        })\n```\n\n### `AWAY`\n\n`AWAY` will set the bot's \"Playing\" text. If you\nwant to change the prefix to something else, you can set the non-standard IRCv3\nclient tag `+discordapp.com/type` to (`Playing`, `Streaming`, `Listening to` or\n`Watching`). The `+discordapp.com/status` tag can be set to `'online'`,\n`'idle'`, `'dnd'` or `'invisible'`.\n\n## Installation and setting up\n\nYou can install `miniirc_discord` with `pip`. On Linux-based systems, you would\ndo `sudo pip3 install miniirc_discord`. Version numbers should follow SemVer\nsince 0.4.0 and are no longer in sync with `miniirc`.\n\n## Getting a bot token\n\nTo get a Discord bot token and invite link, see [this guide]. Make sure you\nenable the message content intent in the bot settings page.\n\n[GitHub]:       https://github.com/luk3yx/miniirc\n[GitLab]:       https://gitlab.com/luk3yx/miniirc\n[Discord]:      https://discord.com\n[discord.py]:   https://github.com/Rapptz/discord.py\n[this guide]:   https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-\u0026-getting-a-token\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluk3yx%2Fminiirc_discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluk3yx%2Fminiirc_discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluk3yx%2Fminiirc_discord/lists"}