From 332f1730d6fa5647e83541ff7725027a499b07b4 Mon Sep 17 00:00:00 2001 From: Supositware Date: Sun, 16 Oct 2022 22:30:00 +0200 Subject: [PATCH] stableHorde api key --- .env.example | 3 ++- commands/fun/stablediffusion.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index dbe3dce..3304cc2 100644 --- a/.env.example +++ b/.env.example @@ -12,4 +12,5 @@ twiTokenSecret=TwitterSecretToken twiChannel=ChannelWhereJustTheTwitterLinkAreSent twiLogChannel=ChannelWhereTheDetailedInfoOfTheCommandIsSent botsggToken=APITokenForBots.gg -botsggEndpoint=https://discord.bots.gg/api/v1 \ No newline at end of file +botsggEndpoint=https://discord.bots.gg/api/v1 +stableHordeApi=0000000000 \ No newline at end of file diff --git a/commands/fun/stablediffusion.js b/commands/fun/stablediffusion.js index dfb6c47..437b7c6 100644 --- a/commands/fun/stablediffusion.js +++ b/commands/fun/stablediffusion.js @@ -3,6 +3,8 @@ import fetch from 'node-fetch'; import fs from 'node:fs'; import os from 'node:os'; +const { stableHordeApi } = process.env; + export default { data: new SlashCommandBuilder() .setName('stablediffusion') @@ -42,7 +44,7 @@ async function generate(i, prompt) { const fetchParameters = { method: 'post', body: JSON.stringify(body), - headers: { 'Content-Type': 'application/json', 'apikey': '0000000000' }, + headers: { 'Content-Type': 'application/json', 'apikey': stableHordeApi }, }; let response = await fetch('https://stablehorde.net/api/v2/generate/sync', fetchParameters);