Only count biggest loser messages in one guild
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user