mirror of
https://github.com/cassoule/flopobot_v2.git
synced 2026-01-18 16:37:40 +01:00
fix: netlify QOL changes
This commit is contained in:
36
.env.sample
36
.env.sample
@@ -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=
|
||||
@@ -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`;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user