Skip to content

A Yahoo Fantasy Sports bot for Discord

License

Notifications You must be signed in to change notification settings

jordymackenz/harambot

 
 

Repository files navigation

Harambot

Python License Build Version

Deploy

A Yahoo Fantasy sports bot for Discord.

Commands

$ping                           - Gives the latency of harambot
$RIP                            - Pay respects
$standings                      - Returns the current standings of the current league
$roster "Team name"             - Returns the roster of the given team
$stats "Player Name"            - Returns the details of the given player
$trade                          - Create poll for latest trade for league approval
$matchups                       - Returns the current weeks matchups

Prerequisites

In order to properly configure your bot you will need the following:

  • Discord API Token
  • Yahoo API Client Id & Secret
  • Yahoo League ID

Discord API Token

  1. Navigate to https://discord.com/developers/applications and click the "New Application" button discord-new-application
  2. Give your bot a name
  3. Navigate to the bot section of your application and click the "Add Bot" button discord-add-bot
  4. Click the "Copy" button under token to copy your bots API token to your clipboard discord-copy-token

Yahoo API Client ID & Secret

  1. Navigate to https://developer.yahoo.com/apps/ and click the "Create an App" button yahoo-create-app
  2. Fill out the form as shown below, you can provide your own values for Application Name, Description, and Homepage URL. Once complete click the "Create App" button yahoo-app-details
  3. Copy the Client ID and Client Secret values yahoo-app-secrets

Yahoo League ID

You can find your league's ID under the settings page of your league yahoo-league-id

Deployment

Heroku

Harambot now supports heroku deployments!

Click the button at the top and fill out the form with your discord token and yahoo api client key and and secret.

heroku-deployment

Once the deployment is complete enable the dyno

heroku-dyno

Local deployment

  1. Clone this repository

     git clone [email protected]:DMcP89/harambot.git
     cd harambot
    
  2. Run the bot.

    On local machine

     make run
    

    With Docker

     make build-image
     make run-docker
    

Setup

Add the bot to your guild

  1. Generate a OAuth url from the discord developer portal using the bot scope and the following permissions:
  • Send Messages
  • Send Messages in Threads
  • Embed Links
  • Attach Files
  • Read Message History
  • Add Reactions
  • Use Slash Commands

The permission value should be 277025507392

discord-oauth

  1. Set the gateway intents

In order for the bot to work properly it requires the following intents:

  • Sever Members Intent
  • Message Content Intent

discord-intents

  1. Navigate to the generated url in a web browser and authorize the bot for your guild

discord-oauth-url-1 discord-oauth-url-2

Configure your guild

  • When the bot joins your guild for the first time it will DM you to complete the guild setup

discord-config-dm

  • You can reconfigure your guild by running the configure slash command from your guild

discord-config-command

Command Examples

$stats Rashaad Penny

player-details

$roster Lamb Chop's Play-Along

roster

$standings

standings

$matchups

matchups

$trade

trade

$RIP "My Season"

rip

About

A Yahoo Fantasy Sports bot for Discord

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 95.2%
  • Makefile 2.6%
  • Dockerfile 2.1%
  • Procfile 0.1%