diff --git a/.env.sample b/.env.sample deleted file mode 100644 index a53645f..0000000 --- a/.env.sample +++ /dev/null @@ -1,36 +0,0 @@ -APP_ID= -DISCORD_TOKEN= -PUBLIC_KEY= - -# Server, used only for chaos timer -GUILD_ID= - -# Role that can vote, only people with this role will be considered to calculate the majority -VOTING_ROLE_ID= - -# Polls max up time, in seconds -# default: 300 (5 minutes) -POLL_TIME=300 - -# Minimum votes needed, active if greater than majority -# default: 2 (prevents votes needed to be 1 if majority == 1) -MIN_VOTES=2 - -# Probability of quoi -> feur, between 0 and 1 -# default : 0.3 (30% chance of Flopobot saying 'feur' when someone says 'quoi') -FEUR_PROB=0.3 - -# Probability of triggering the chaos timer at midnight, between 0 and 1 -# default : 0.1 (10% chance of Flopobot picking randomely a user to time out for 12 hours at midnight) -CHAOS_PROB=0.1 - -# Everyone can be picked at the chaos timer -# default : false (Only VOTING_ROLE_ID users can be picked) -EVERYONE_IN_CHAOS=false - -# Every time the death roulette, cron expression -# default : '0 0 * * *' (Every day at midnight) -#CRON_EXPR='*/1 * * * * *' -CRON_EXPR='0 0 * * *' - -OPENAI_API_KEY= \ No newline at end of file diff --git a/src/bot/commands/floposite.js b/src/bot/commands/floposite.js index 0f4db3a..5a009f9 100644 --- a/src/bot/commands/floposite.js +++ b/src/bot/commands/floposite.js @@ -8,7 +8,7 @@ import { InteractionResponseType, MessageComponentTypes, ButtonStyleTypes } from */ export async function handleFlopoSiteCommand(req, res) { // The URL for the link button. Consider moving to .env if it changes. - const siteUrl = process.env.FLOPOSITE_URL || "https://floposite.com"; + const siteUrl = process.env.FLOPOSITE_URL; // The URL for the thumbnail image. const thumbnailUrl = `${process.env.API_URL}/public/images/flopo.png`; diff --git a/src/utils/ai.js b/src/utils/ai.js index f1a1296..17b02fe 100644 --- a/src/utils/ai.js +++ b/src/utils/ai.js @@ -34,7 +34,7 @@ export async function gork(messageHistory) { try { // --- OpenAI Provider --- - if (modelProvider === "OpenAI" && openai) { + if (modelProvider.toLowerCase() === "openai" && openai) { const completion = await openai.chat.completions.create({ model: "gpt-5", // Using a modern, cost-effective model reasoning_effort: "low", @@ -44,7 +44,7 @@ export async function gork(messageHistory) { } // --- Google Gemini Provider --- - else if (modelProvider === "Gemini" && gemini) { + else if (modelProvider.toLowerCase() === "gemini" && gemini) { // Gemini requires a slightly different history format. messageHistory.forEach((message) => { console.log(message.role); @@ -76,7 +76,7 @@ export async function gork(messageHistory) { } // --- Mistral Provider --- - else if (modelProvider === "Mistral" && mistral) { + else if (modelProvider.toLowerCase() === "mistral" && mistral) { const chatResponse = await mistral.chat({ model: "mistral-large-latest", messages: messageHistory, diff --git a/src/utils/index.js b/src/utils/index.js index f8f246e..429fa35 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -136,7 +136,7 @@ export function setupCronJobs(client, io) { }); // Daily at midnight: Reset daily rewards and init SOTD - cron.schedule("0 0 * * *", async () => { + cron.schedule(process.env.CRON_EXPR, async () => { console.log("[Cron] Running daily midnight tasks..."); try { resetDailyReward.run();