Discord Bots

Nov 11, 2017 • Cody Stephenson

I’ve created a few bots for Discord. Most of them use discord.py, but I’ve also been tinkering with discord.js. They can all be accessed through my GitHub repositories page.


Winston

Winston was the first bot I created. Additional functionality was added bit by bit.

Features

  • Uses the OW API from SunDwarf over at GitHub to display a given player’s top 5 most played and winrates in competitive OverWatch
  • Queries WolframAlpha using the WolframAlpha API if the instruction isn’t understood. This results in somewhat of an AI experience, as well as helping with Math problems!
  • Interfaces with the Music Bot to easily store and play multiple playlists
  • Provides an easy way of seeing the server’s roles, a specific user’s role, etc.
  • Contains a blacklist feature to handle the occasional abusive user
  • Picks OverWatch an individual OverWatch hero given an optional parameter of hero-type (attack/defense, etc)
  • Generates an entire OverWatch balanced 2-2-2 team at random

Creating this one has been an awesome learning experience. I’ve used several APIs, new data structures, and implemented the blacklist feature which uses some filo I/O (but only when needed of course).


OSRS Bot

This bot was requested by u/Make2Much over at reddit. It scrapes the Old-school runescape wikia site for a given monster’s drops. It then simulates an indidual drop for that monster with (pretty accurate!) estimated drop rates if a specific item has an unknown drop rate. I got my first taste of beautiful-soup for web scraping here! Near the top of the file, drop rates and mobs with multiple drops can be configured.

alt text


DnDBot

This is an ongoing project. The goal is to have the bot assist both players and the dungeon master while playing Dungeons and Dragons 5e. This project is a mutual effort between some friends and I. We decided to go with discord.js as they were more comfortable going with javascript, but it’s actually been fun (if challenging) learning to manage the asynchronous manner of nodejs.

Features

  • A reactive interface that displays inventory, skills, and stats for a given character
  • A dice rolling feature capable of rolling multiple types of dice multiple times
  • Can query the D&D 5e API to search skills, classes, and more
  • Simulate loot drops given a character’s level
  • Can create a folder for each character full of json items to be able to pause/resume play
  • more to come

alt text


OW RSS bot

This bot functions as a method of alterting my friends and I on Discord when an OverWatch patch occurs. The patch notes are fetched from an RSS feed and pushed to our servers after being converted from html to markdown.