Only count biggest loser messages in one guild

This commit is contained in:
2026-03-03 18:34:07 -08:00
parent 907a7caec6
commit c181669159
2 changed files with 18 additions and 5 deletions

View File

@@ -466,7 +466,11 @@ async function scheduleBiggestLoser(firstTime = false) {
const channel = <TextChannel>await client.channels.fetch(process.env.LOSER_CHANNEL);
if (channel) {
try {
const declaration = await sendBiggestLoserAnnouncement(client, channel);
const declaration = await sendBiggestLoserAnnouncement(
client,
channel,
channel.guild.id
);
logInfo(`[bot] Declaring biggest loser: ${declaration}`);
await channel.send(declaration);

View File

@@ -361,11 +361,20 @@ export async function triggerThrowback(
`[helpers] Selected throwback message from ${randomMsg.author.username}: "${randomMsg.cleanContent}"`
);
// Generate LLM response using the standard system prompt
const llmResponse = await provider.requestLLMResponse([randomMsg], sysprompt, llmconf);
// Fetch message history for context (like onNewMessage does)
const history = await sourceChannel.messages.fetch({
limit: llmconf.msg_context - 1,
before: randomMsg.id,
});
// Send reply to target channel
await targetChannel.send(llmResponse);
const historyMessages = [...history.values()].reverse();
const cleanHistoryList = [...historyMessages, randomMsg];
// Generate LLM response with context
const llmResponse = await provider.requestLLMResponse(cleanHistoryList, sysprompt, llmconf);
// Send reply to the original message
await randomMsg.reply(llmResponse);
logInfo(`[helpers] Sent throwback reply: ${llmResponse}`);
return {