From 5ed9d2f3ce9ff0ea17fea600705dafea37e9e65a Mon Sep 17 00:00:00 2001 From: dece Date: Fri, 9 Oct 2020 22:34:32 +0200 Subject: [PATCH] bot: clean --- Pipfile | 2 +- Pipfile.lock | 14 +------------- README.md | 21 +++++++++++++++++++-- edmond/plugin.py | 8 ++++---- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/Pipfile b/Pipfile index bf58ead..0819fbd 100644 --- a/Pipfile +++ b/Pipfile @@ -6,7 +6,7 @@ verify_ssl = true [dev-packages] [packages] -irc = "~=19.0.1" +irc = "*" requests = "*" [requires] diff --git a/Pipfile.lock b/Pipfile.lock index fb2a633..5170c2f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "024a36b2b9e61302df7560d7af32ef1c9802327f23381e327cacb345adf56eb7" + "sha256": "b9ea2a09600a7aba7d67761e0e8338ba3711a93442f9be86e950621b70be216f" }, "pipfile-spec": 6, "requires": { @@ -35,7 +35,6 @@ "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6", "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==2.10" }, "importlib-metadata": { @@ -59,7 +58,6 @@ "sha256:116429c2047953f525afdcae165475c4589c7b14870e78b2d068ecb01018827e", "sha256:c38698ff8ef932eb33d91c0e8fc192ad7c44ecee03f7f585afd4f35aeaef7aab" ], - "markers": "python_version >= '3.6'", "version": "==3.1.0" }, "jaraco.collections": { @@ -67,7 +65,6 @@ "sha256:a7889f28c80c4875bd6256d9924e8526dacfef22cd7b80ff8469b4d312f9f144", "sha256:be570ef4f2e7290b757449395238fa63d70a9255574624e73c5ff9f1ee554721" ], - "markers": "python_version >= '3.6'", "version": "==3.0.0" }, "jaraco.functools": { @@ -75,7 +72,6 @@ "sha256:9fedc4be3117512ca3e03e1b2ffa7a6a6ffa589bfb7d02bfb324e55d493b94f4", "sha256:d3dc9f6c1a1d45d7f59682a3bf77aceb685c1a60891606c7e4161e72ecc399ad" ], - "markers": "python_version >= '3.6'", "version": "==3.0.1" }, "jaraco.logging": { @@ -83,7 +79,6 @@ "sha256:31716fe84d3d5df39d95572942513bd4bf8ae0a478f64031eff4c2ea9e83434e", "sha256:b05ed07101883997a30e05c2472798d86129803d9961a0d1081a3236ad37c52a" ], - "markers": "python_version >= '3.6'", "version": "==3.0.0" }, "jaraco.stream": { @@ -91,7 +86,6 @@ "sha256:287e1cba9f278e0146fdded6bc40518930813a5584579769aeaa1d0bfd178a73", "sha256:a42357141288bbd55938b9ff464173c078038374ce5ffa1bf31895138acc0f30" ], - "markers": "python_version >= '3.6'", "version": "==3.0.0" }, "jaraco.text": { @@ -99,7 +93,6 @@ "sha256:c87569c9afae14f71b2e1c57f316770ab6981ab675d9c602be1c7981161bacdd", "sha256:e5078b1126cc0f166c7859aa75103a56c0d0f39ebcafc21695615472e0f810ec" ], - "markers": "python_version >= '2.7'", "version": "==3.2.0" }, "more-itertools": { @@ -107,7 +100,6 @@ "sha256:6f83822ae94818eae2612063a5101a7311e68ae8002005b5e05f03fd74a86a20", "sha256:9b30f12df9393f0d28af9210ff8efe48d10c94f73e5daf886f10c4b0b0b4f03c" ], - "markers": "python_version >= '3.5'", "version": "==8.5.0" }, "pytz": { @@ -130,7 +122,6 @@ "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'", "version": "==1.15.0" }, "tempora": { @@ -138,7 +129,6 @@ "sha256:599a3a910b377f2b544c7b221582ecf4cb049b017c994b37f2b1a9ed1099716e", "sha256:9f46de767be7dd21d9602a8a5b0978fd55abc70af3e2a7814c85c00d7a8fffa3" ], - "markers": "python_version >= '3.6'", "version": "==4.0.0" }, "urllib3": { @@ -146,7 +136,6 @@ "sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a", "sha256:e7983572181f5e1522d9c98453462384ee92a0be7fac5f1413a1e35c56cc0461" ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", "version": "==1.25.10" }, "zipp": { @@ -154,7 +143,6 @@ "sha256:64ad89efee774d1897a58607895d80789c59778ea02185dd846ac38394a8642b", "sha256:eed8ec0b8d1416b2ca33516a37a08892442f3954dee131e92cfd92d8fe3e7066" ], - "markers": "python_version >= '3.6'", "version": "==3.3.0" } }, diff --git a/README.md b/README.md index b01e875..0c3455d 100644 --- a/README.md +++ b/README.md @@ -5,16 +5,33 @@ New version of the infamous IRC bot. +Installation +------------ + +Clone the repository and install main dependencies using Pipenv: + +```bash +pipenv install +``` + +Plugins dependencies can be manually installed with + +```bash +pipenv run pip install -r edmond/plugins/requirements.txt +``` + + + Missing features ---------------- - [x] Actions (/me) - [x] Beers - [x] Mood -- [ ] Random: dice, choice, etc +- [x] Random: ~~dice~~, choice, etc - [ ] Notes - [ ] Handle compliments -- [ ] Handle +- [ ] Handle insults - [x] Horoscope - [x] "Journee mondiale" - [ ] Mug diff --git a/edmond/plugin.py b/edmond/plugin.py index 269d2e7..4ab5a20 100644 --- a/edmond/plugin.py +++ b/edmond/plugin.py @@ -9,8 +9,8 @@ class Plugin: def __init__(self, bot): self.bot = bot self.name = self.__class__.__name__.lower()[:-6] # Remove "Plugin". - self.config = self.get_config() - self.is_ready = self.check_config() + self.config = self._get_config() + self.is_ready = self._check_config() @property def callbacks(self): @@ -21,7 +21,7 @@ class Plugin: if cb.startswith("on_") and callable(getattr(self, cb)) } - def get_config(self): + def _get_config(self): """Return the plugin section from the bot config, plus common values.""" plugins_configs = self.bot.config["plugins"] config = plugins_configs["common"].copy() @@ -37,7 +37,7 @@ class Plugin: self.bot.log_e(f"Could not load resource at {resource_path}.") return config - def check_config(self): + def _check_config(self): """Return True if the plugin config is properly setup.""" missing = False for key in self.REQUIRED_CONFIGS: