added logging to console

This commit is contained in:
TanguyPcFixe 2025-07-15 18:03:01 +02:00
parent fd841916c9
commit dbf17783a1

View File

@ -2,6 +2,7 @@ import discord
from discord.ext import commands from discord.ext import commands
import requests import requests
import json import json
from datetime import datetime as dt
### reads token files ### reads token files
@ -74,6 +75,7 @@ async def delivery(ctx,
response = requests.post(gsheetToken, json.dumps(data), headers={"Content-Type": "application/json"}) response = requests.post(gsheetToken, json.dumps(data), headers={"Content-Type": "application/json"})
if response.status_code == 200: if response.status_code == 200:
await ctx.followup.send(f"your delivery of {quantity} of {commodity} to a {target} has been added to the sheet!") await ctx.followup.send(f"your delivery of {quantity} of {commodity} to a {target} has been added to the sheet!")
print(f"[dt.isoformat(dt.now())]{author} delivery of {quantity} of {commodity} to a {target}")
else: else:
await ctx.followup.send(f"Failed to log delivery (HTTP {response.status_code}). Please contact the yellow people if that keeps happening") await ctx.followup.send(f"Failed to log delivery (HTTP {response.status_code}). Please contact the yellow people if that keeps happening")
except Exception as e: except Exception as e: