Skip to content

Commit

Permalink
Add groundwork code.
Browse files Browse the repository at this point in the history
Add command to plot histogram of problems solved.
  • Loading branch information
meooow25 committed Mar 30, 2019
1 parent f4af510 commit 94f40fe
Show file tree
Hide file tree
Showing 6 changed files with 372 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ venv.bak/

# mypy
.mypy_cache/

.idea/
pip-wheel-metadata/
249 changes: 249 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.poetry]
name = "TLE"
version = "0.1.0"
description = ""
authors = ["meooow25 <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.7"
matplotlib = "^3.0"
"discord.py" = { git = "https://github.com/Rapptz/discord.py.git", branch = "rewrite" }

[tool.poetry.dev-dependencies]
pytest = "^3.0"

[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
1 change: 1 addition & 0 deletions tle/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.1.0'
28 changes: 28 additions & 0 deletions tle/__main__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import logging
from os import environ
from pathlib import Path

from discord.ext import commands

BOT_TOKEN = environ.get('BOT_TOKEN')


def main():
if not BOT_TOKEN:
logging.error('Token required')
return
bot = commands.Bot(command_prefix=commands.when_mentioned_or("!"))
cogs = [file.stem for file in Path('tle', 'cogs').glob('*.py')]
for extension in cogs:
try:
bot.load_extension(f'tle.cogs.{extension}')
except Exception as e:
logging.error(f'Failed to load extension {extension}: {e})')

logging.info(f'Cogs loaded...')
bot.run(BOT_TOKEN)
logging.info(f'Bot running...')


if __name__ == '__main__':
main()
Loading

0 comments on commit 94f40fe

Please sign in to comment.