Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
debugging
Browse files
app.py
CHANGED
|
@@ -20,8 +20,12 @@ from pytz import timezone # for times
|
|
| 20 |
import asyncio # check if used
|
| 21 |
|
| 22 |
zurich_tz = timezone("Europe/Zurich")
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
def convert_to_timezone(dt, tz):
|
| 27 |
return dt.astimezone(tz).strftime("%Y-%m-%d %H:%M:%S %Z")
|
|
@@ -70,7 +74,10 @@ async def on_message_edit(before, after):
|
|
| 70 |
#embed.set_footer(text=f"{datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S UTC')}")
|
| 71 |
embed.set_footer(text=f"{convert_to_timezone(datetime.utcnow(), zurich_tz)}")
|
| 72 |
|
| 73 |
-
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
@bot.event
|
| 76 |
async def on_message_delete(message):
|
|
|
|
| 20 |
import asyncio # check if used
|
| 21 |
|
| 22 |
zurich_tz = timezone("Europe/Zurich")
|
| 23 |
+
intents = discord.Intents.all()
|
| 24 |
+
bot = commands.Bot(command_prefix='!', intents=intents)
|
| 25 |
+
LOG_CHANNEL = bot.get_channel(1126516932527534111)
|
| 26 |
+
print(f"LOG_CHANNEL: {LOG_CHANNEL}")
|
| 27 |
+
# test = 1126516932527534111
|
| 28 |
+
# bot-test = 1100458786826747945
|
| 29 |
|
| 30 |
def convert_to_timezone(dt, tz):
|
| 31 |
return dt.astimezone(tz).strftime("%Y-%m-%d %H:%M:%S %Z")
|
|
|
|
| 74 |
#embed.set_footer(text=f"{datetime.utcnow().strftime('%Y-%m-%d %H:%M:%S UTC')}")
|
| 75 |
embed.set_footer(text=f"{convert_to_timezone(datetime.utcnow(), zurich_tz)}")
|
| 76 |
|
| 77 |
+
if LOG_CHANNEL is not None:
|
| 78 |
+
await LOG_CHANNEL.send(embed=embed)
|
| 79 |
+
else:
|
| 80 |
+
print("Log channel not found.")
|
| 81 |
|
| 82 |
@bot.event
|
| 83 |
async def on_message_delete(message):
|