The official source code of the Magic Space Cat Discord bot. Everything here is readily available if you want to host your own instance, with full commands and permission customisation.
Official bot invite: https://discord.com/api/oauth2/authorize?client_id=503580226035384340&permissions=8&scope=bot
- Open a terminal to the root directory of this project.
- Run
python -m pip install .
(Yes the dot is part of the command) - That's it.
- Navigate to any directory on your filesystem to store bot data in.
- Run
python -m spacecat
. - Follow the instructions.
You'll go through this stuff when you run the program, don't worry.
- Create a new application and set a name.
- Open the 'Bot' tab on the left.
- Select 'Create a Bot' and confirm.
- Click on 'Copy' under Token. (Don't ever reveal this token to anyone you don't trust)
- Open Discord.
- Open your user settings.
- Open the appearance tab.
- Enable 'Developer Mode' under Advanced.
- Exit user settings.
- Right click on your user and click "Copy ID".
To make use of the Musicbox module in order to stream songs from sources such as YouTube or Spotify, you must set up a Lavalink server. This is an efficient audio playback server that the module is designed to interface with. A reworked built-in solution may be implemented at a later date, but will likely still not be as performant as Lavalink.
Here are some steps to set it all up:
- Install a minimum of Java 13.
- Download Lavalink from GitHub and save it to a known location.
- Create a file called
application.yml
with the contents of this example - Find the line labelled "password" and set it to your own secure password.
- Run Lavalink using Java with the command
java -jar Lavalink.jar
. - Ensure that SpaceCat Discord Bot has been run at least once, and an instance has been created.
- Navigate to data/<instance name> in the SpaceCat files.
- Open the config and edit the IP address, port, and password of the Lavalink server. (Default IP of 0.0.0.0 works if the Lavalink server is on the same computer as SpaceCat)
- Restart the bot and have fun!
If you want Spotify support, here are additional steps to get it to work:
- Go to the Spotify Developer Dashbard (Ensure you already have a spotify account)
- Create an App with whatever name you want.
- Take the Client ID and Client Secret from the top left corner.
- Navigate to data/<instance name> in the SpaceCat files.
- Open the config and edit the client_id and client_secret of the Spotify API.
- Restart the bot and have fun!
The bot can be invited to servers you have admistrator permissions in.
- Select your bot.
- Open the 'OAuth2' tab on the left.
- Select 'bot' in the scopes category.
- Select the permissions that you want your bot to have.
- Copy the link.
Simply insert this link into your web browser and replace the placeholder with the Client ID from your discord application page. This link allows the bot to have full control over the server, which may have certain security and trust issues.
https://discord.com/api/oauth2/authorize?client_id=PLACEHOLDER&permissions=8&scope=bot