From d113f1c4d02cec6187a95310fb458a5efcc3227d Mon Sep 17 00:00:00 2001 From: Silke pilon Date: Mon, 20 Nov 2023 19:35:39 +0100 Subject: [PATCH] Update discord import in plugin.py and server.py --- lodestone/plugin.py | 5 ++++- lodestone/server.py | 10 ++++++++-- plugins/discord_bot.py | 5 ++++- pyproject.toml | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/lodestone/plugin.py b/lodestone/plugin.py index 5df3eeb..78fcae0 100644 --- a/lodestone/plugin.py +++ b/lodestone/plugin.py @@ -1,5 +1,8 @@ import lodestone -from discord import Embed +try: + from discord import Embed +except: + pass import datetime try: from discord import SyncWebhook diff --git a/lodestone/server.py b/lodestone/server.py index 668f938..25969ec 100644 --- a/lodestone/server.py +++ b/lodestone/server.py @@ -1,5 +1,8 @@ from rich.console import Console -from discord import Embed +try: + from discord import Embed +except: + pass import structlog import datetime import sys @@ -149,7 +152,10 @@ def __check_python_command(self): def __logging(self, message, icon="💾", error=False, info=False, warning=False, chat=False, image_url="", console=True, discord=True): if not self.disable_logs: if self.discord_webhook and discord: - from discord import Embed + try: + from discord import Embed + except: + pass color = 0x3498db if error: color = 0x992d22 diff --git a/plugins/discord_bot.py b/plugins/discord_bot.py index 1a22f64..2390bb4 100644 --- a/plugins/discord_bot.py +++ b/plugins/discord_bot.py @@ -1,6 +1,9 @@ import lodestone import re -from discord import SyncWebhook, Embed +try: + from discord import SyncWebhook, Embed +except: + pass import datetime from types import FunctionType diff --git a/pyproject.toml b/pyproject.toml index 8e7d960..b67de42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "lodestone" -version = "0.0.35" +version = "0.0.36" description = "🤖 Create Minecraft bots with a powerful, stable, and high level Python API." authors = [ { name = "Silke Pilon", email = "silkepilon2009@gmail.com" },