Skip to content
Terry Agapitos edited this page Feb 8, 2020 · 11 revisions

Welcome to the PCSocBot wiki!

Dependencies

  • ffmpeg (Version 2.8.15 or greater is preferred)
  • python3.6 (3.7 breaks discord.py)

Note: If you're on Ubuntu and want the latest version of ffmpeg (latest versions perform better and are less error-prone when dealing with youtube-dl), do

sudo add-apt-repository ppa:jonathonf/ffmpeg-4 -y
sudo apt update
sudo apt install ffmpeg -y

(-y means say yes to everything)

This will add the unofficial repository jonathonf, don't do this if you don't trust the author/repo!

Linux

You'll need to use your package manager to get these (e.g. apt, pacman, etc.).

  • libffi-dev
  • python3-dev (not sure about this one; try without and see what happens)

MacOS

Things are a bit broken in Mac Land. Here's how to fix it

Windows

Good one.

If you're really set on doing this, install WSL/Ubuntu from the Windows Store. This will give you a Ubuntu shell from which you can work off. I recommend installing a different terminal emulator (e.g. cmder or conemu) and pointing the shell at WSL instead.

Then, get the Linux dependencies and continue with setup.

Setup

Virtual Environment

I know your eyes are glazing over right now, but it's actually easier (and more important) than you think!

You can get virtual environments up and running in 3 easy steps:

Get venv

If you have python3, you'll have the venv module already!

Setup your virtual environment

Run python3 -m venv env in the root directory. If you have multiple python versions installed, use python3.6.

Get in/out of your new virtual environment

To enter your shiny new virtual environment, run source env/bin/activate. You'll know if you're in your virtual environment if you can see (env) above or before your prompt, like so:

$ source env/bin/activate
(env) $ 

To leave your virtual environment, run deactivate.

Requirements

Run pip3 install -r requirements.txt. Make sure you're in your virtual environment!

API Keys

Currently, you'll need 3 API keys to actually run the bot: Discord, YouTube, and Twitch. default.ini first needs to be duplicated and renamed to config.ini, where you need to add API keys for these three services. config.ini is in the .gitignore, so this won't be pushed live.

To get these, you'll need to:

  • Discord: Go to your developer dashboard and make a new application with bot scopes. To invite it to your server, you can use the OAuth2 link generator (under the OAuth2 tab of your Application's dashboard) to generate a link to invite your bot.

  • YouTube: Follow these instructions and get your API Key.

  • Twitch: Go to your developer dashboard and ask @Prant if you need further help because I didn't set it up ¯\_(ツ)_/¯

And you're basically done! If you'd like to know more, I used this article as a reference.

Running

Run bot.py or server.sh for a keep-alive version that persists through crashes.

Make sure you test on your own server. If you are really stuck, ask us and we can guide you through the process.

If you only want the core Discord stuff to use in your own bot, you can ignore commands by adding them in your config.ini file.

Contributing

You know the deal, open an issue or PR and we'll get to it eventually. If you're not sure how, follow this handy guide

Code-base is very, very extensible thanks to Matt, just look in commands and see how things go. Notable good examples are pingpong.py, mod.py to start and someone.py for something more spicy 🔥.

If you really want to dive in and learn how things are done, check out /bot.py and /commands/base.py.

Check out some of the current issues to see what needs to be worked on. Make a new issue if you want to work on something.

Resources

Read the discord.py docs

Discord - Ping us in #programming for hand-holding.