{"id":17224287,"url":"https://github.com/botder/mtasa-discord-bot","last_synced_at":"2025-10-12T13:36:01.677Z","repository":{"id":37081806,"uuid":"55906678","full_name":"botder/mtasa-discord-bot","owner":"botder","description":"Connects MTA:SA servers and Discord channels by sending messages/commands back and forth","archived":false,"fork":false,"pushed_at":"2023-10-16T16:13:10.000Z","size":99,"stargazers_count":60,"open_issues_count":2,"forks_count":42,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T14:52:22.890Z","etag":null,"topics":["discord","discord-bot","discord-js","javascript","lua","mtasa","mtasa-resource","multi-theft-auto"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/botder.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":"2016-04-10T15:25:08.000Z","updated_at":"2025-03-19T18:02:55.000Z","dependencies_parsed_at":"2024-10-15T04:10:52.458Z","dependency_job_id":"e70a75e4-9c6e-4b39-b6aa-dc36fb7e88d9","html_url":"https://github.com/botder/mtasa-discord-bot","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/botder%2Fmtasa-discord-bot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botder%2Fmtasa-discord-bot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botder%2Fmtasa-discord-bot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/botder%2Fmtasa-discord-bot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/botder","download_url":"https://codeload.github.com/botder/mtasa-discord-bot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248803806,"owners_count":21164122,"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","discord-bot","discord-js","javascript","lua","mtasa","mtasa-resource","multi-theft-auto"],"created_at":"2024-10-15T04:10:42.616Z","updated_at":"2025-10-12T13:35:56.625Z","avatar_url":"https://github.com/botder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mta-discord-bot\nConnects MTA:SA servers and Discord channels by sending messages/commands back and forth.  \n**Note:** The recent code update has breaking changes to your `config.json`, please replace _server_ with _guild_, thanks.\n\n## Installation\n\n### MTA:SA\nThe discord resource requires the socket module on your MTA:SA server. You can find the installation guide\nand the binaries on the [MTA wiki](https://wiki.multitheftauto.com/wiki/Modules/Sockets).\n\nThe resources themselves require no special setup, you only have to edit the `discord/config.xml` to fit your setup.\nThe resource **discord** is responsible for message transfer between your MTA:SA server and the Discord relay.\nOn the other hand, **discord-events** is listening for events on the MTA:SA server to send these to the relay\nthrough the **discord** resource.\n\n\u003e mta/discord/config.xml\n```xml\n\u003cdiscord\u003e\n    \u003cchannel\u003ename-of-your-channel\u003c/channel\u003e\n    \u003cpassphrase\u003eequal-to-the-server-passphrase\u003c/passphrase\u003e\n    \u003chostname\u003elocalhost\u003c/hostname\u003e\n    \u003cport\u003e8100\u003c/port\u003e\n\u003c/discord\u003e\n```\n\n### Relay\nThe relay server connects to Discord as a bot user; and starts a socket server listening for connections. I never\nbothered to keep the code compatible with older releases of node.js, which might be an issue on some distributions.\n\nThe relay code needs a little preparation before you can run it. You have to run the command `npm install` in the `src`\ndirectory to download the node.js modules required by the application. Furthermore, you have to copy the file\n`src/example.config.json` to `src/config.json` and edit it to fit your setup\n(the passphrase and port must be equal to the **discord** config.xml on your MTA:SA server).\n\nYou can start the relay with `node app.js`, but you should consider using [pm2](https://github.com/Unitech/pm2) to restart\nthe relay automatically on crashes.\n\n\u003e src/example.config.json\n```json\n{\n    \"port\": 8100,\n    \"passphrase\": \"key\",\n    \"guild\": \"guild.id\",\n    \"bots\": [{\n        \"channel\": \"channel.name\",\n        \"token\": \"bot.token\"\n    }]\n}\n```\n\n## Notes\n\n### Discord Bots\n\n\u003e **Note**\n\u003e Make sure your bot account has the `MESSAGE CONTENT INTENT` permission, because otherwise you will only see empty messages coming from Discord (in MTA:SA).\n\u003e \n\u003e ![image](https://github.com/botder/mtasa-discord-bot/assets/38703318/f0df9eb7-cc40-44f6-8b22-3a7e38cfbc0d)\n\nThis application doesn't magically add your bot(s) to your guild(s). You (better said: the guild owner) have to authorize every bot user. Navigate to your bot application on the following page and note the client id:\n\u003e https://discord.com/developers/applications\n\nThen continue to replace the `client_id` field in the URL below and navigate to that page:\n\u003e https://discord.com/api/oauth2/authorize?scope=bot\u0026permissions=0\u0026client_id=\u003cyour_client_id_here\u003e\n\nProceed by authorizing the bot for the guild of your choice and you're done.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotder%2Fmtasa-discord-bot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbotder%2Fmtasa-discord-bot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbotder%2Fmtasa-discord-bot/lists"}