![harambot-banner](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_banner.png)
# Harambot
_An interactive Yahoo Fantasy sports bot for Discord._
![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue) ![License](https://img.shields.io/badge/License-MIT-green) ![Build](https://img.shields.io/github/actions/workflow/status/DMcP89/harambot/unit-tests.yml?branch=main) ![Version](https://img.shields.io/badge/version-0.4.2--Beta-red)
[![Discord](https://img.shields.io/badge/Add_Harambot_To_Your_Server-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white)](http://harambot.io)
## Commands
/ping - Gives the latency of harambot
/RIP - Pay respects
/standings - Returns the current standings of the current league
/roster Team - Returns the roster of the given team
/stats Player - Returns the details of the given player
/trade - Create a poll for latest trade for league approval
/matchups week - Returns the matchups for the given week, defaults to the current week
/waiver days - Returns the waiver wire transactions from the previous number of days
/configure - Configure the bot for your guild
/reports - Set what channel transaction reports should be sent to.
You can find example output of these commands [here](https://github.com/DMcP89/harambot/wiki#command-examples)
## Roll your own instance
### Prerequisites
In order to properly configure your bot you will need the following:
* [Discord API Token](https://github.com/DMcP89/harambot/wiki/Prerequisites#discord-api-token)
* [Yahoo API Client Id & Secret](https://github.com/DMcP89/harambot/wiki/Prerequisites#yahoo-api-client-id--secret)
* [Yahoo League ID](https://github.com/DMcP89/harambot/wiki/Prerequisites#yahoo-league-id)
_Visit our [wiki](https://github.com/DMcP89/harambot/wiki) for a step by step guide on how to obtain these values._
#### Generate a key for your local database
Parts of the database are encrypted, which means we need to generate a key. Using the python interactive interpreter, you can generate one by running these three lines inside the interpreter:
```
from cryptography.fernet import Fernet
fernet_key = Fernet.generate_key()
print(fernet_key.decode())
```
Your key will appear below.
### Run the bot on [Render](https://render.com/)
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/DMcP89/harambot)
### Run the bot locally using pip package
1. Install the harambot package using pip
pip install harambot
2. Export the following environment variables
```
export DISCORD_TOKEN='[YOUR DISCORD TOKEN]'
export YAHOO_KEY='[YOUR YAHOO API CLIENT ID]'
export YAHOO_SECRET='[YOUR YAHOO API CLIENT SECRET]'
export DATABASE_URL='[YOUR DATABASE URL]' # which can be a pathway to a file, such as 'sqllite:///harambot.db'
export HARAMBOT_KEY='[YOUR ENCRYPTION KEY]' # A URL-safe base64-encoded 32-byte key
```
3. Run the bot
harambot
### Run the bot locally using docker
1. Pull the latest image from docker hub
docker pull dmcp89/harambot
2. Export the following environment variables
```
export DISCORD_TOKEN='[YOUR DISCORD TOKEN]'
export YAHOO_KEY='[YOUR YAHOO API CLIENT ID]'
export YAHOO_SECRET='[YOUR YAHOO API CLIENT SECRET]'
export DATABASE_URL='[YOUR DATABASE URL]'
export HARAMBOT_KEY='[YOUR ENCRYPTION KEY]' # A URL-safe base64-encoded 32-byte key
```
3. Run the bot
docker run --name harambot \
-e DISCORD_TOKEN=$DISCORD_TOKEN \
-e YAHOO_KEY=$YAHOO_KEY \
-e YAHOO_SECRET=$YAHOO_SECRET \
-e DATABASE_URL=$DATABASE_URL \
-e HARAMBOT_KEY=$HARAMBOT_KEY \
--rm dmcp89/harambot
## 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
* Manage WebHooks
The permission value should be 277562378304
![discord-oauth](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/discord-oauth-generator.png)
2. Navigate to the generated url in a web browser and authorize the bot for your guild
![discord-oauth-url-1](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/discord-oauth-url-authorize-1.png)
![discord-oauth-url-2](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/discord-oauth-url-authorize-2.png)
### Configure your guild
* Once your bot is added to your guild you can configure it by using the /configure command:
![discord-config-commnd](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_1.png)
* Use the Login with Yahoo button to authenticate with Yahoo and get your Yahoo token (this is a one time token)
![discord-config-yahoo](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_4.png)
* Use the Configure Guild button to configure your guild for the bot
![discord-config-guild](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_2.png)
* You can reconfigure your guild by running the configure command and clicking the Configure Guild button.
![discord-config-guild](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_3.png)
Raw data
{
"_id": null,
"home_page": "http://harambot.io",
"name": "harambot",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "yahoo, yahoo fantasy sports, fantasy football, fantasy basketball, fantasy baseball, fantasy hockey, discord, bot",
"author": "DMcP89",
"author_email": "davemcpherson@wochstudios.com",
"download_url": "https://files.pythonhosted.org/packages/f7/bc/8be02970c8bdcf1c5eaf05b70e01b9d5b5fa6a6e53daf12dfcd389b918e0/harambot-0.4.2.tar.gz",
"platform": null,
"description": "![harambot-banner](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_banner.png)\n# Harambot\n_An interactive Yahoo Fantasy sports bot for Discord._\n\n![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10-blue) ![License](https://img.shields.io/badge/License-MIT-green) ![Build](https://img.shields.io/github/actions/workflow/status/DMcP89/harambot/unit-tests.yml?branch=main) ![Version](https://img.shields.io/badge/version-0.4.2--Beta-red)\n\n\n\n\n\n[![Discord](https://img.shields.io/badge/Add_Harambot_To_Your_Server-%235865F2.svg?style=for-the-badge&logo=discord&logoColor=white)](http://harambot.io)\n\n\n\n\n\n## Commands\n /ping - Gives the latency of harambot\n /RIP - Pay respects\n /standings - Returns the current standings of the current league\n /roster Team - Returns the roster of the given team\n /stats Player - Returns the details of the given player\n /trade - Create a poll for latest trade for league approval\n /matchups week - Returns the matchups for the given week, defaults to the current week\n /waiver days - Returns the waiver wire transactions from the previous number of days\n /configure - Configure the bot for your guild\n /reports - Set what channel transaction reports should be sent to.\n\nYou can find example output of these commands [here](https://github.com/DMcP89/harambot/wiki#command-examples)\n\n\n## Roll your own instance\n\n### Prerequisites\n\nIn order to properly configure your bot you will need the following:\n\n* [Discord API Token](https://github.com/DMcP89/harambot/wiki/Prerequisites#discord-api-token)\n* [Yahoo API Client Id & Secret](https://github.com/DMcP89/harambot/wiki/Prerequisites#yahoo-api-client-id--secret)\n* [Yahoo League ID](https://github.com/DMcP89/harambot/wiki/Prerequisites#yahoo-league-id)\n\n_Visit our [wiki](https://github.com/DMcP89/harambot/wiki) for a step by step guide on how to obtain these values._\n\n#### Generate a key for your local database\n\nParts of the database are encrypted, which means we need to generate a key. Using the python interactive interpreter, you can generate one by running these three lines inside the interpreter:\n\n```\nfrom cryptography.fernet import Fernet\nfernet_key = Fernet.generate_key()\nprint(fernet_key.decode())\n```\n\nYour key will appear below.\n\n### Run the bot on [Render](https://render.com/)\n\n[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/DMcP89/harambot)\n\n### Run the bot locally using pip package\n\n1. Install the harambot package using pip\n\n pip install harambot\n\n2. Export the following environment variables\n\n ```\n export DISCORD_TOKEN='[YOUR DISCORD TOKEN]'\n export YAHOO_KEY='[YOUR YAHOO API CLIENT ID]'\n export YAHOO_SECRET='[YOUR YAHOO API CLIENT SECRET]'\n export DATABASE_URL='[YOUR DATABASE URL]' # which can be a pathway to a file, such as 'sqllite:///harambot.db'\n export HARAMBOT_KEY='[YOUR ENCRYPTION KEY]' # A URL-safe base64-encoded 32-byte key\n ```\n\n3. Run the bot\n\n harambot\n\n### Run the bot locally using docker\n\n1. Pull the latest image from docker hub\n\n docker pull dmcp89/harambot\n\n2. Export the following environment variables\n\n ```\n export DISCORD_TOKEN='[YOUR DISCORD TOKEN]'\n export YAHOO_KEY='[YOUR YAHOO API CLIENT ID]'\n export YAHOO_SECRET='[YOUR YAHOO API CLIENT SECRET]'\n export DATABASE_URL='[YOUR DATABASE URL]'\n export HARAMBOT_KEY='[YOUR ENCRYPTION KEY]' # A URL-safe base64-encoded 32-byte key\n ```\n\n3. Run the bot\n\n docker run --name harambot \\\n -e DISCORD_TOKEN=$DISCORD_TOKEN \\\n -e YAHOO_KEY=$YAHOO_KEY \\\n -e YAHOO_SECRET=$YAHOO_SECRET \\\n -e DATABASE_URL=$DATABASE_URL \\\n -e HARAMBOT_KEY=$HARAMBOT_KEY \\\n --rm dmcp89/harambot\n\n\n## Setup\n\n### Add the bot to your guild\n1. Generate a OAuth url from the discord developer portal using the bot scope and the following permissions:\n\n* Send Messages\n* Send Messages in Threads\n* Embed Links\n* Attach Files\n* Read Message History\n* Add Reactions\n* Use Slash Commands\n* Manage WebHooks\n\nThe permission value should be 277562378304\n\n![discord-oauth](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/discord-oauth-generator.png)\n\n2. Navigate to the generated url in a web browser and authorize the bot for your guild\n\n![discord-oauth-url-1](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/discord-oauth-url-authorize-1.png)\n![discord-oauth-url-2](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/discord-oauth-url-authorize-2.png)\n\n### Configure your guild\n\n* Once your bot is added to your guild you can configure it by using the /configure command:\n\n\n![discord-config-commnd](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_1.png)\n\n* Use the Login with Yahoo button to authenticate with Yahoo and get your Yahoo token (this is a one time token)\n\n\n![discord-config-yahoo](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_4.png)\n\n* Use the Configure Guild button to configure your guild for the bot\n\n\n![discord-config-guild](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_2.png)\n\n\n* You can reconfigure your guild by running the configure command and clicking the Configure Guild button.\n\n\n![discord-config-guild](https://raw.githubusercontent.com/DMcP89/harambot/main/assests/harambot_configure_3.png)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Yahoo Fantasy Sports bot for Discord",
"version": "0.4.2",
"project_urls": {
"Homepage": "http://harambot.io",
"Repository": "https://github.com/DMcP89/harambot"
},
"split_keywords": [
"yahoo",
" yahoo fantasy sports",
" fantasy football",
" fantasy basketball",
" fantasy baseball",
" fantasy hockey",
" discord",
" bot"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31f19b57451eecf9ae03a0c621be74d766028c28e80e601017421afbe5cceed3",
"md5": "411888e66f0ff2d2ff79b200c35c86c2",
"sha256": "143d7c7d85aa0120d52ec4f3d4df750a24670028a9243b1e5b3fde7c0b12f413"
},
"downloads": -1,
"filename": "harambot-0.4.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "411888e66f0ff2d2ff79b200c35c86c2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 20339,
"upload_time": "2024-09-06T03:10:21",
"upload_time_iso_8601": "2024-09-06T03:10:21.643633Z",
"url": "https://files.pythonhosted.org/packages/31/f1/9b57451eecf9ae03a0c621be74d766028c28e80e601017421afbe5cceed3/harambot-0.4.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f7bc8be02970c8bdcf1c5eaf05b70e01b9d5b5fa6a6e53daf12dfcd389b918e0",
"md5": "f5fa3054bda2ffa47840c1e343e60140",
"sha256": "3501c49ba2643e98f26e4b16ba4efb5713cb7c324d993356a03dfd12df29ae1f"
},
"downloads": -1,
"filename": "harambot-0.4.2.tar.gz",
"has_sig": false,
"md5_digest": "f5fa3054bda2ffa47840c1e343e60140",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 6245488,
"upload_time": "2024-09-06T03:10:23",
"upload_time_iso_8601": "2024-09-06T03:10:23.229005Z",
"url": "https://files.pythonhosted.org/packages/f7/bc/8be02970c8bdcf1c5eaf05b70e01b9d5b5fa6a6e53daf12dfcd389b918e0/harambot-0.4.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-06 03:10:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DMcP89",
"github_project": "harambot",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "harambot"
}