chore(env): update webhook configuration in .env.example and main.py 🔧
- Replaced API_KEY and WEBHOOK_URL with WEBHOOK_N8N_IMGFLIP_KEY and WEBHOOK_N8N_IMGFLIP_URL for better clarity and functionality. *Generated by Github Copilot*
This commit is contained in:
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
DISCORD_TOKEN=
|
DISCORD_TOKEN=
|
||||||
WEBHOOK_URL=
|
WEBHOOK_N8N_IMGFLIP_URL=
|
||||||
API_KEY=
|
WEBHOOK_N8N_IMGFLIP_KEY=
|
||||||
+5
-2
@@ -26,10 +26,13 @@ async def meme(interaction: discord.Interaction, prompt: str):
|
|||||||
try:
|
try:
|
||||||
# Call the webhook with the prompt and API key
|
# Call the webhook with the prompt and API key
|
||||||
webhook_payload = {"query": prompt}
|
webhook_payload = {"query": prompt}
|
||||||
headers = {"apiKey": os.getenv("API_KEY"), "Content-Type": "application/json"}
|
headers = {
|
||||||
|
"apiKey": os.getenv("WEBHOOK_N8N_IMGFLIP_KEY"),
|
||||||
|
"Content-Type": "application/json",
|
||||||
|
}
|
||||||
async with httpx.AsyncClient() as httpx_client:
|
async with httpx.AsyncClient() as httpx_client:
|
||||||
response = await httpx_client.post(
|
response = await httpx_client.post(
|
||||||
os.getenv("WEBHOOK_URL"),
|
os.getenv("WEBHOOK_N8N_IMGFLIP_URL"),
|
||||||
json=webhook_payload,
|
json=webhook_payload,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
timeout=120,
|
timeout=120,
|
||||||
|
|||||||
Reference in New Issue
Block a user