This code is being deprecated, please consider using roblox-rtc instead.
this is currently broken, I will make a video after it's fixed.
note: this tutorial assumes that if you are using a PC for setup and not Glitch you are on a Windows PC. this especially influences step 17
- Download the latest release as a ZIP file.
- Extract it to a folder. In this guide, it will be referred to as "the folder".
- Open
config.json
. - Go to https://discord.com/developers. Skip 4-6 if you have an existing application with a bot account.
- Create an application.
- Create a bot account under "Bot".
- Copy your token. WARNING: THIS TOKEN IS VERY SENSITIVE. IF STOLEN, MALICIOUS PEOPLE CAN USE IT TO IMPERSONATE YOUR BOT, POTENTIALLY GETTING IT DELETED. KEEP THIS PRIVATE!!!!
- Go back to
config.json
and set the"token"
value to the token you copied. Make sure it is wrapped in quotation marks (for example,"token": "h8wa7y67sagd657w6dwad"
<-- this isn't a real token). - Go to https://create.roblox.com/credentials and press "Create API Key".
- Under "Access Permissions", select "Messaging Service API" and then press "Add API System"
- Add the desired experience that you want to link to the Discord bot. You have to have created it.
- Once you have selected the experience, hit "Add Experience"
- Then, under "Experience Operations", select "Publish".
- Enter the IP addresses that you want to allow to use this API key. I recommend using Glitch and uploading the files there.
- If you are using Glitch, go to your project's terminal and run
curl https://ifconfig.me
. Don't worry, it only exposes the project's IP address. Copy and use this IP address in the IP addresses you want to allow on the API key.
- If you are using Glitch, go to your project's terminal and run
- Create the API key with your choice of expiration date and copy it. WARNING: THIS TOKEN IS ALSO VERY SENSITIVE AND THOSE WITH MALICIOUS INTENT CAN SEND NSFW CONTENT TO GAME SERVERS, POSSIBLY GETTING YOUR GAME BANNED FROM ROBLOX. KEEP THIS PRIVATE!!!!
- Go back to
config.json
and set therobloxAPIKey
field to the copied API key. - Invite your bot to the desired guild/Discord server using the OAuth2 URI generator in the Discord Developer Dashboard (in the Application > OAuth2). Make sure you set the scopes to
bot
andapplication.commands
. - Enable developer mode in the Discord app and copy the guild/server ID and set the
guildId
field inconfig.json
to the guild ID. - This step varies if you are on Glitch or on a PC.
- If you are on Glitch, do the following:
- Literally wait for the server to start having an output. There should be a rather large object in console that looks like this:
'1014652224237994027' => <ref *1> ApplicationCommand { id: '1014652224237994027', applicationId: '1001498584476287076', guild: Guild { id: '776094501353160735', name: 'Your Server', icon: '35a647be0c7429754008970168d1dd9d', features: [Array], commands: [GuildApplicationCommandManager], members: [GuildMemberManager], channels: [GuildChannelManager], bans: [GuildBanManager], roles: [RoleManager], presences: PresenceManager {}, voiceStates: [VoiceStateManager], stageInstances: [StageInstanceManager], invites: [GuildInviteManager], scheduledEvents: [GuildScheduledEventManager], available: true, shardId: 0, splash: null, banner: null, description: null, verificationLevel: 3, vanityURLCode: null, nsfwLevel: 0, premiumSubscriptionCount: 2, discoverySplash: null, memberCount: 250, large: true, premiumProgressBarEnabled: true, applicationId: null, afkTimeout: 300, afkChannelId: null, systemChannelId: '867433635401039882', premiumTier: 1, widgetEnabled: null, widgetChannelId: null, explicitContentFilter: 2, mfaLevel: 0, joinedTimestamp: 1661982325549, defaultMessageNotifications: 1, systemChannelFlags: [SystemChannelFlagsBitField], maximumMembers: 500000, maximumPresences: null, maxVideoChannelUsers: 25, approximateMemberCount: null, approximatePresenceCount: null, vanityURLUses: null, rulesChannelId: '867434090520117279', publicUpdatesChannelId: '977526280285225041', preferredLocale: 'en-US', ownerId: '993715743055163515', emojis: [GuildEmojiManager], stickers: [GuildStickerManager] }, guildId: '776094501353160735', permissions: ApplicationCommandPermissionsManager { manager: [Circular *4], guild: [Guild], guildId: '776094501353160735', commandId: '1014652224237994027' }, type: 1, name: 'dtr', nameLocalizations: null, nameLocalized: null, description: 'Execute a Discord-to-Roblox moderation action.', descriptionLocalizations: null, descriptionLocalized: null, options: [ [Object], [Object], [Object], [Object], [Object] ], defaultMemberPermissions: null, dmPermission: null, version: '1017519180637011988' }
- If you see this, continue to the next step.
- If you are on a PC, local computer, or virtual machine:
- Go into the folder and create a file named "start.txt"
- Open the file and type
npm i node .
- Close the file and rename it
start.bat
. - Double click the file to run it.
- If you see a command prompt open with the same output as seen in the Glitch steps, then continue to the next step.
- If you are on Glitch, do the following:
- Use the
DiscordToRobloxLuaScript.rbxm
file that you downloaded in the folder and insert it into your Roblox place insideServerScriptService
. Make sure the script is not disabled.