{"id":16485335,"url":"https://github.com/morganconrad/runequest-discordbot","last_synced_at":"2025-05-02T03:30:38.847Z","repository":{"id":71410007,"uuid":"323935928","full_name":"MorganConrad/runequest-discordbot","owner":"MorganConrad","description":"A Discord \"bot\" for Chaosium's Runequest RPG.","archived":false,"fork":false,"pushed_at":"2021-11-01T16:08:28.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T21:42:57.530Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/MorganConrad.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-12-23T15:22:44.000Z","updated_at":"2022-11-07T10:49:11.000Z","dependencies_parsed_at":"2023-03-17T11:15:38.479Z","dependency_job_id":null,"html_url":"https://github.com/MorganConrad/runequest-discordbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Frunequest-discordbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Frunequest-discordbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Frunequest-discordbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorganConrad%2Frunequest-discordbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MorganConrad","download_url":"https://codeload.github.com/MorganConrad/runequest-discordbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251981007,"owners_count":21675059,"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":[],"created_at":"2024-10-11T13:25:29.264Z","updated_at":"2025-05-02T03:30:38.840Z","avatar_url":"https://github.com/MorganConrad.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/flyingspaniel"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://secure.travis-ci.org/MorganConrad/runequest-discordbot.png)](https://travis-ci.org/MorganConrad/runequest-discordbot)\n[![License](https://img.shields.io/badge/license-MIT-A31F34.svg)](https://github.com/MorganConrad/runequest-discordbot)\n# runequest-discordbot\n\nA [Discord](https://discord.com/) bot to support [Chaosium's](https://www.chaosium.com/) fantasy role playing game\n[Runequest](https://www.chaosium.com/runequest/).\nListens for commands with the prefix /rq.\n - All text is converted to lowercase\n - Mentions (e.g. @JohnDoe) are ignored.\n\n[Technical Presentation for Port Townsend Web Developers](docs/presentation.md)\n\n### New Beta Feature, dierollr, as of November 2021\n\n - Commands starting with the prefix /r are treated as die roll commands\n - [Instructions here](https://github.com/MorganConrad/runequest-discordbot/tree/main/dierollr#readme)\n - code in the dierollr folder\n\n\n## Discordbot Commands (all start with /rq)\n\nMany commands take one or more optional numbers NN in the range 01-100 (00 also means 100), or use \"x\" to mean pick one at random\n\n|command|arguments|description|shortcut|\n|-------|---------|-----------|--------|\n|resistance|AA DD|calculate resistance table percent for Attacker (AA) vs. Defender (DD)|rt|\n|success   |SS RR|show ability result (Normal, Critical, etc.) for skill SS and roll RR|ar|\n|melee     |AL PL|show end result for Attacker level of success (e.g. special) vs. Parry level (e.g. failure)||\n|meleedodge|AL DL|show end result for Attacker level of success (e.g. special) vs. Dodge level (e.g. critical)|\n|fumble    |NN?  |fumble NN, or random|fu, fa, fp, fd|\n|chaos     |NN?  |Chaotic Feature NN, or random|cf|\n|thed      |NN?  |Curse of Thed NN, or random|ct|\n|spirit    |NN?  |Summon Ancestral Spirit NN, or random||\n|spell     |NN?  |Spirit Magic Spell NN, or random|sm|\n|help      |     |Help||\n|info      |     |Information||\n\n\n#### Alternatives (shortcut aliases) for Levels of Success (save typing)\n```\n - critical: cr, crit\n - special:  sp, impale, slash, crush\n - normal:   n, ok, hit, parry, dodge, success\n - failure:  m, miss\n - fumble:   fu, fa, fp, fd\n```\n\n## Examples (notes in parentheses)\n\n```\n/rq success 56 58    (skill 56, roll 58)\nAbility: 56  Roll: 58 =\u003e Failure\n\n/rq meleedodge slash miss     (special attack vs. missed dodge)\nAttack special vs. Dodge failure:\nAttack does special success damage.\n\n/rq melee m sp  (missed attack vs. special parry)\nAttack failure vs. Parry special:\nAttack parried or deflected.\nDefender rolls parrying weapon’s special damage.\nAttacking weapon’s HP is reduced by any damage over its current HP.\n\n/rq fumble       (Random fumble, show both attack and parry result)\nFumble #83:\n  Attack: Weapon shattered (100% chance if unenchanted;\n10% less for each point of battle magic spell on weapon,\nand 20% less for each point of Rune magic spell on weapon).\n  Parry:  Parrying weapon or shield shattered (100% chance if unenchanted;\n10% less for each point of battle magic spell on weapon,\nand 20% less for each point of Rune magic spell on weapon).\n\n/rq fa 83      (Fumbled attack 83)\nFumble #83: Weapon shattered (100% chance if unenchanted;\n10% less for each point of battle magic spell on weapon,\nand 20% less for each point of Rune magic spell on weapon).\n\n/rq resistance 14 12\nResistance Table: 14 vs. 12 =\u003e 60\n\n\n/rq chaos @abc 77  (chaotic feature 77, the mention is ignored)\nChaos Feature #77: Functional extra appendage or body part. Modify hit locations accordingly.\n\n/rq thed 54 x x  (Curse of Thed 54, plus 2 random ones)\nCurse Of Thed #54: Add +3 to damage of all weapons hitting the victim.*\nCurse Of Thed #63: Victim becomes physically indistinguishable from caster of spell.\nCurse Of Thed #48: All foes have +30% chance to hit victim.*\n\n/rq spirit       (random spirit)\nAncestral Spirit #37: Neutral, POW 3D6+6, 1D3 Spirit Spells, 0 Rune Points\nUse /rq spell ... to generate random spirit spells\n\n/rq spell x x      (generate 2 random spirit magic spells)\nSpirit Magic #90: Visibility\nSpirit Magic #72: Spirit Screen\n```\n\nMany of the commands have shorter aliases as noted.\n## Installation\n\n### The bot may or may not be running on my Raspberry pi.\n\nTo try that, use the invite link\n[https://discord.com/oauth2/authorize?client_id=791106265283690497\u0026scope=bot](https://discord.com/oauth2/authorize?client_id=791106265283690497\u0026scope=bot)\n\nPlease don't overdo it!  Currently, this server only collects and logs information on\n - servers (\"guilds\") at startup.\n - errors.\n - when it is used on a new server or channel.\n\n### Create your own version\nThis requires a basic familiarity with javascript and node.js.\n 1. Download the code\n 2. `npm install`\n 3. Login to Discord, go to the developers page, and create your app.\n    - You should get a different magic number than in the above link.\n     - also note the \"secret\"\n     - Invite it to your server or channel.  It should show up as offline\n 4. On the computer with the code. `node index.js SECRET`\n    - or, better, store secret in the `RQ_DiscordBotKey` environment variable\n 5. The rq bot should shortly appear as \"online\".\n\n### Configuration\n\nsee config.js.  You can change the prefix (and other things) there.\n\n## Design Notes\n\n### The main bot code is in runequest-discordbot.js.  It\n  - reads all the command bots in the subdirectory './commands'\n  - `setup()` does initial login, and installing listeners\n  - converts the input to lowercase\n  - checks for the prefix \"/rq\"\n  - gets the arguments, filtering out any mentions\n  - checks for and handles \"help\" and \"info\"\n  - most commands are handled via `delegateToCommands()`\n\n### Writing your own command\n\nTo add your own command, follow the overall design in any of the existing commands.  You must export\n\n - name:    a user-friendly name, e.g. \"ChaosFeature\",\n - aliases: an array of commands you support, e.g. ['cf', 'chaosfeature']\n    - use lowercase, since the input has been converted toLowerCase.\n    - don't conflict with other ones!\n - help:    a help string\n\nYou should export **one** of the following\n - `data[]`:  an array of 101 strings. Useful if this is just a random table like Chaos Features.\n   - 0 is filler.\n   - `'\"'` means \"ditto\" to save typing.\n - `doHandle(userCommand, args, utils, command)` for something more complex.\n   - userCommand: the command they used, e.g. \"cf\"\n   - args[]:  any remaining args, e.g. ['65', '89']\n   - utils: some utiity functions\n   - command: your command (sort of `this`, usually ignored`)\n\n#### Testing\n\n`test.js` is a command line utility to test your command handler.\n\n `node test.js /rq mycommand arg0 arg1`\n\nThe tests folder holds some very basic unit tests.\n\n## TODOs\n\n - better permanent server\n - ~~allow multiple arguments to some commands, like `cf 56 33 88` to show three chaotic features~~ done as of v0.1.1\n - more commands TBD\n - fix bugs TBD\n\n\u003cbr\u003e\n\u003ca href=\"https://www.buymeacoffee.com/flyingspaniel\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 60px !important;width: 217px !important;\" \u003e\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Frunequest-discordbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorganconrad%2Frunequest-discordbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorganconrad%2Frunequest-discordbot/lists"}