Audience: friends I’m teaching to code.

Warning, these are likely to change as WSL and do.

If you get stuck anywhere or want to know more, DM me!


A Discord bot on your local computer that runs when your computer is on.


  • Know how to read

You will learn

  • How to read long instructions, ignoring irrelevant info so you can find what you need quickly
  • How to use PowerShell, the Windows command line
  • How to use Bash, the Linux command line


  • (if Windows) install Windows Subsystem for Linux and upgrade it to version 2
  • Install Windows Terminal
  • Install Python and library
  • Make a new Discord Server and add me/the bot to it
  • Copy some quickstart code into a file and save it

Install WSL v2

Instructions adapted from these, I’ve pulled out the relevant parts as of August 2020.

I recommend WSLv2 because it is easier to work with.

  • Enable WSL
    • Open PowerShell as Administrator (search for it, right click -> run as administrator)
    • Paste the following into it:
    • dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
  • Make sure Windows is a high enough version
    • Press Windows key and r, type winver
    • Verify (OS Build xxxxx) is >= 19041
    • If not, update Windows
  • Enable Virtual Machine Platform
    • Open PowerShell as Administrator and run:
    • dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
    • Restart
  • Open Microsoft Store, search for Ubuntu, and install the first result.
  • Open Microsoft Store, search for Windows Terminal, and install the first result.

Install Python

  • Open Windows Terminal to Ubuntu
  • Type the following into the command line
    • sudo apt update && sudo apt install python3 python3-pip -y && pip3 install

Create a Discord bot and add it to your server

  • Make a new Discord server.
  • Create a bot and add it to this server.
  • Save the bot token!

Create the bot code

  • In Ubuntu:
    • touch
    • explorer .
  • Open with a text editor (right click -> Open with...).
  • Paste the following code in and save (adding your token):
# from
# This example requires the 'message_content' intent.

import discord

intents = discord.Intents.default()
intents.message_content = True

client = discord.Client(intents=intents)

async def on_ready():
    print(f'We have logged in as {client.user}')

async def on_message(message):
    if == client.user:

    if message.content.startswith('$hello'):
        await'Hello!')'your token here')

And that’s it!

Start the bot with python3

Check the discord server and try typing $hello!

Edit the bot by:

  • changing (try changing $hello to $greetings)
  • saving the file
  • hitting Ctrl and c in the terminal window
  • typing python3 again (or pushing up arrow key and then enter).

If you got stuck anywhere, DM me.