-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from DMcP89/dev
Dev
- Loading branch information
Showing
9 changed files
with
641 additions
and
569 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,6 @@ RUN pip install -U pip | |
|
||
RUN pip install harambot | ||
|
||
EXPOSE 10000 | ||
|
||
CMD ["harambot"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
[default] | ||
LOGLEVEL = "DEBUG" | ||
VERSION = "0.0.3-Beta" | ||
VERSION = "0.3.1-Beta" | ||
RUN_MIGRATIONS = false | ||
PORT = 10000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from aiohttp import web | ||
from discord.ext import commands | ||
from harambot.config import settings | ||
|
||
import logging | ||
|
||
logger = logging.getLogger(__file__) | ||
logger.setLevel(logging.INFO) | ||
|
||
|
||
class WebServer(commands.Cog): | ||
def __init__(self, bot): | ||
self.bot = bot | ||
|
||
async def webserver(self): | ||
async def handler(request): | ||
status = f""" | ||
Harambot | ||
Harambot v{settings.version} is running! | ||
Bot status: {request.config_dict["bot"].status} | ||
Latency: {round(request.config_dict["bot"].latency * 1000)}ms | ||
""" | ||
return web.Response(text=status) | ||
|
||
app = web.Application() | ||
app.router.add_get("/", handler) | ||
app["bot"] = self.bot | ||
runner = web.AppRunner(app) | ||
await runner.setup() | ||
site = web.TCPSite(runner, "0.0.0.0", settings.port) | ||
await self.bot.wait_until_ready() | ||
await site.start() | ||
logger.info("Webserver started on port {}".format(settings.port)) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "harambot" | ||
version = "0.3.0" | ||
version = "0.3.1" | ||
description = "A Yahoo Fantasy Sports bot for Discord" | ||
authors = ["DMcP89 <[email protected]>"] | ||
license = "MIT" | ||
|
@@ -29,7 +29,7 @@ packages = [ | |
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
discord = "^2.1.0" | ||
"discord.py" = "^2.1.0" | ||
dynaconf = "^3.1.11" | ||
peewee = "^3.15.4" | ||
cachetools = "^5.2.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
services: | ||
- type: web | ||
name: harambot-servicet | ||
runtime: image | ||
image: | ||
url: docker.io/dmcp89/harambot:latest | ||
plan: free | ||
envVars: | ||
- key: DISCORD_TOKEN | ||
sync: false | ||
- key: YAHOO_KEY | ||
sync: false | ||
- key: YAHOO_SECRET | ||
sync: false | ||
- key: DATABASE_URL | ||
fromDatabase: | ||
name: harambot-database | ||
property: connectionString | ||
|
||
databases: | ||
- name: harambot-database | ||
databaseName: harambot | ||
user: harambot | ||
plan: free |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,55 @@ | ||
aiohttp==3.8.3 ; python_version >= "3.8" and python_version < "4.0" | ||
aiosignal==1.3.1 ; python_version >= "3.8" and python_version < "4.0" | ||
async-timeout==4.0.2 ; python_version >= "3.8" and python_version < "4.0" | ||
attrs==22.1.0 ; python_version >= "3.8" and python_version < "4.0" | ||
black==22.10.0 ; python_version >= "3.8" and python_version < "4.0" | ||
cachetools==5.2.0 ; python_version >= "3.8" and python_version < "4.0" | ||
certifi==2022.12.7 ; python_version >= "3.8" and python_version < "4" | ||
cfgv==3.3.1 ; python_version >= "3.8" and python_version < "4.0" | ||
charset-normalizer==2.1.1 ; python_version >= "3.8" and python_version < "4.0" | ||
click==8.1.3 ; python_version >= "3.8" and python_version < "4.0" | ||
colorama==0.4.6 ; python_version >= "3.8" and python_version < "4.0" and sys_platform == "win32" or python_version >= "3.8" and python_version < "4.0" and platform_system == "Windows" | ||
coverage[toml]==6.5.0 ; python_version >= "3.8" and python_version < "4.0" | ||
discord-py==2.1.0 ; python_version >= "3.8" and python_version < "4.0" | ||
discord==2.1.0 ; python_version >= "3.8" and python_version < "4.0" | ||
distlib==0.3.6 ; python_version >= "3.8" and python_version < "4.0" | ||
docopt==0.6.2 ; python_version >= "3.8" and python_version < "4.0" | ||
dynaconf==3.1.11 ; python_version >= "3.8" and python_version < "4.0" | ||
exceptiongroup==1.0.4 ; python_version >= "3.8" and python_version < "3.11" | ||
filelock==3.8.0 ; python_version >= "3.8" and python_version < "4.0" | ||
flake8==5.0.4 ; python_version >= "3.8" and python_version < "4.0" | ||
frozenlist==1.3.3 ; python_version >= "3.8" and python_version < "4.0" | ||
identify==2.5.8 ; python_version >= "3.8" and python_version < "4.0" | ||
idna==3.4 ; python_version >= "3.8" and python_version < "4.0" | ||
iniconfig==1.1.1 ; python_version >= "3.8" and python_version < "4.0" | ||
mccabe==0.7.0 ; python_version >= "3.8" and python_version < "4.0" | ||
multidict==6.0.2 ; python_version >= "3.8" and python_version < "4.0" | ||
mypy-extensions==0.4.3 ; python_version >= "3.8" and python_version < "4.0" | ||
mysqlclient==2.1.1 ; python_version >= "3.8" and python_version < "4.0" | ||
nodeenv==1.7.0 ; python_version >= "3.8" and python_version < "4.0" | ||
objectpath==0.6.1 ; python_version >= "3.8" and python_version < "4.0" | ||
packaging==21.3 ; python_version >= "3.8" and python_version < "4.0" | ||
pathspec==0.10.2 ; python_version >= "3.8" and python_version < "4.0" | ||
peewee==3.15.4 ; python_version >= "3.8" and python_version < "4.0" | ||
platformdirs==2.5.4 ; python_version >= "3.8" and python_version < "4.0" | ||
pluggy==1.0.0 ; python_version >= "3.8" and python_version < "4.0" | ||
pre-commit==2.20.0 ; python_version >= "3.8" and python_version < "4.0" | ||
psycopg2==2.9.5 ; python_version >= "3.8" and python_version < "4.0" | ||
pyaml==21.10.1 ; python_version >= "3.8" and python_version < "4.0" | ||
pycodestyle==2.9.1 ; python_version >= "3.8" and python_version < "4.0" | ||
pyflakes==2.5.0 ; python_version >= "3.8" and python_version < "4.0" | ||
pyparsing==3.0.9 ; python_version >= "3.8" and python_version < "4.0" | ||
pytest-cov==4.0.0 ; python_version >= "3.8" and python_version < "4.0" | ||
pytest==7.2.0 ; python_version >= "3.8" and python_version < "4.0" | ||
pytz==2023.2 ; python_version >= "3.8" and python_version < "4.0" | ||
pyyaml==6.0 ; python_version >= "3.8" and python_version < "4.0" | ||
rauth==0.7.3 ; python_version >= "3.8" and python_version < "4.0" | ||
requests==2.28.2 ; python_version >= "3.8" and python_version < "4" | ||
setuptools==65.5.1 ; python_version >= "3.8" and python_version < "4.0" | ||
toml==0.10.2 ; python_version >= "3.8" and python_version < "4.0" | ||
tomli==2.0.1 ; python_version >= "3.8" and python_full_version < "3.11.0a7" | ||
typing-extensions==4.4.0 ; python_version >= "3.8" and python_version < "3.10" | ||
urllib3==1.26.15 ; python_version >= "3.8" and python_version < "4" | ||
virtualenv==20.16.7 ; python_version >= "3.8" and python_version < "4.0" | ||
yahoo-fantasy-api==2.7.0 ; python_version >= "3.8" and python_version < "4.0" | ||
yahoo-oauth==2.0 ; python_version >= "3.8" and python_version < "4.0" | ||
yarl==1.8.1 ; python_version >= "3.8" and python_version < "4.0" | ||
aiohttp==3.8.3 | ||
aiosignal==1.3.1 | ||
async-timeout==4.0.2 | ||
attrs==22.1.0 | ||
black==22.10.0 | ||
cachetools==5.2.0 | ||
certifi==2022.12.7 | ||
cfgv==3.3.1 | ||
charset-normalizer==2.1.1 | ||
click==8.1.3 | ||
colorama==0.4.6 | ||
coverage[toml]==6.5.0 | ||
discord.py==2.1.0 | ||
distlib==0.3.6 | ||
docopt==0.6.2 | ||
dynaconf==3.1.11 | ||
exceptiongroup==1.0.4 | ||
filelock==3.8.0 | ||
flake8==5.0.4 | ||
frozenlist==1.3.3 | ||
identify==2.5.8 | ||
idna==3.4 | ||
iniconfig==1.1.1 | ||
mccabe==0.7.0 | ||
multidict==6.0.2 | ||
mypy-extensions==0.4.3 | ||
mysqlclient==2.1.1 | ||
nodeenv==1.7.0 | ||
objectpath==0.6.1 | ||
packaging==21.3 | ||
pathspec==0.10.2 | ||
peewee==3.15.4 | ||
platformdirs==2.5.4 | ||
pluggy==1.0.0 | ||
pre-commit==2.20.0 | ||
psycopg2==2.9.5 | ||
pyaml==21.10.1 | ||
pycodestyle==2.9.1 | ||
pyflakes==2.5.0 | ||
pyparsing==3.0.9 | ||
pytest-cov==4.0.0 | ||
pytest==7.2.0 | ||
pytz==2023.2 | ||
pyyaml==6.0 | ||
rauth==0.7.3 | ||
requests==2.28.2 | ||
setuptools==65.5.1 | ||
toml==0.10.2 | ||
tomli==2.0.1 | ||
typing-extensions==4.4.0 | ||
urllib3==1.26.15 | ||
virtualenv==20.16.7 | ||
yahoo-fantasy-api==2.7.0 | ||
yahoo-oauth==2.0 | ||
yarl==1.8.1 |