Log into the discord developer portal: https://discord.com/developers/applications
Create new application, name it whatever you want, and agree to the ToS
Once the page refreshes, go to OAuth2, and click on URL Generator
Under "Scopes", checkbox "bot"
Under "Role Permissions", checkbox "Send Messages" and "Attach Files"
Scroll to the bottom, copy the Generated URL and paste it into an address bar in your browser
Invite it to your server
Head back to the Discord Developer Page and configure the bots username, and click "Reset" token Remember the token, the bot will need it to come online! If you forget it, you will have to regenerate it!
On the Discord server, modify the channel permissions for the bot's role
Congratulations you just created and invited your own discord bot!
You can run the python script directly on your PC. Note that you will need to have chromium
and chromium-chromedriver
installed and added to the PATH.
python3 discord_screenshot_bot.py [-c|--config] <config-file>
NOTE: If you already added the discord bot token and channel ID as environment variables, you don't need to specify the config file. It will default to use the environment variables.
run.sh
file but passing the -b|--build
flag. Use ./run.sh --help
for more information on the image name:./run.sh -c <config-file> [-b|--build]
NOTE: Because of the way flags are parsed, the -b flag needs to be at the end. This is due to the fact that the parser is looking for a flag-value pair
.config
) with the following format and flags:TOKEN = "<bot_token>"
ID = "<channel_id>" # "692925474032320542"
IMAGE = "<docker_image_name>" # "hiddenglovework/ss-discordbot:v1.0.0"
CONTAINER_NAME = "<container_name>" # "gw-discord-ss-bot"
NOTE: Make sure to include the space around the
=
and wrap all values in double quotes (the config parsing is very basic)
./run.sh [-c | --config] <config_file_path>
NOTE: for more information on the script run:
./run.sh --help
Run ./ruin.sh --help
for more information on what flags are needed.
docker stop <docker_container_id>
# or
docker stop <docker_container_name>
NOTE: To find the container id, run
[sudo] docker ps
.
# in the discord channel where the bot is active type this message:
@<insert_bot_name> !screenshot <insert_url>