This is a basic Chrome extension that can host a Discord bot in a web browser.
To use this code, you'll need to replace "YOUR_DISCORD_BOT_TOKEN_HERE" with your own Discord bot token in 'config.json'. You'll also need to install the required libraries by running the following commands in your terminal:
npm install discord.js
npm install ytdl-core
This bot uses the Discord.js library and the ytdl-core library for playing YouTube videos. It listens for messages in the Discord server and responds to the commands "!play" and "!stop". When the "!play" command is triggered, the bot joins the voice channel of the user who sent the message and starts playing a YouTube video. When the "!stop" command is triggered, the bot leaves the voice channel.
-
Zip up the root folder of your extension and upload it to the Chrome Web Store. You will need to create a developer account and pay a one-time fee of $5.
-
Install the extension from the Chrome Web Store and navigate to the Discord login page.
-
Click on the extension icon in the toolbar and select "Start Bot". This should inject the "bot.js" script into the current tab and activate your Discord bot.