Skip to content

Commit

Permalink
Update discord import in plugin.py and server.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SilkePilon committed Nov 20, 2023
1 parent cc9ea7a commit d113f1c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
5 changes: 4 additions & 1 deletion lodestone/plugin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import lodestone
from discord import Embed
try:
from discord import Embed
except:
pass
import datetime
try:
from discord import SyncWebhook
Expand Down
10 changes: 8 additions & 2 deletions lodestone/server.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion plugins/discord_bot.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]" },
Expand Down

0 comments on commit d113f1c

Please sign in to comment.