Skip to content

Commit

Permalink
im so fucking gay oh my god
Browse files Browse the repository at this point in the history
  • Loading branch information
TheYande committed Sep 2, 2024
1 parent d0f37df commit 0d5b91a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 3 additions & 4 deletions modules/ai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getLevelForXp } from "../xp/misc.js";
import { gracefulFetch } from "../../util/promises.js";
import { updateStatus } from "./model-status.js";
import { prompts, freeWillPrompts, dmPrompts } from "./prompts.js";
import log, { LoggingEmojis, LogSeverity } from "../logging/misc.js";

let sharedHistory: { role: string; content: string | any[]; type?: string }[] | undefined = [];

Expand Down Expand Up @@ -208,10 +209,8 @@ async function executeCommands(
output.push("[time]: " + new Date().toString());
break;
case "alert":
await config.channels.mod.send({
content: command.option + "\n" + m.url,
allowedMentions: { parse: ["everyone", "roles"] },
});
await
log(`${LoggingEmojis.Bot} ${command.option + "\n" + m.url}`,LogSeverity.AiAlerts)
break;
case "store":
store(command.option);
Expand Down
2 changes: 1 addition & 1 deletion modules/logging/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default async function logError(
}`,
)
}`,
LogSeverity.ImportantUpdate,
LogSeverity.TheBotFuckedUp,
{
files: [
{
Expand Down
10 changes: 6 additions & 4 deletions modules/logging/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export function shouldLog(channel: TextBasedChannel | null): boolean {
}

export enum LogSeverity {

/**
* Critical alerts that require actions in response. All mods should read this channel, preferably with
* notifications on.
Expand All @@ -62,6 +63,7 @@ export enum LogSeverity {
* - Raid alerts.
*/
Alert,
AiAlerts,
/**
* Updates that are important to know or not easily noticeable otherwise. All mods should read.
*
Expand Down Expand Up @@ -105,11 +107,11 @@ export enum LogSeverity {
*/
Resource,
/**
* Logged for lurkurs,
* for errors when shit fucks up,
*
* - User changed presence.
* - FUCK FUCK ERROR AAAAAAAAAAA.
*/
Lurk,
TheBotFuckedUp,
}

export default async function log(
Expand Down Expand Up @@ -188,7 +190,7 @@ export default async function log(
export async function getLoggingThread(group: LogSeverity): Promise<TextChannel | ThreadChannel> {
if (group === LogSeverity.Alert) return config.channels.modlogs;

const name = `${group}) ${LogSeverity[group]
const name = `${group - 1}) ${LogSeverity[group]
.replaceAll(/([a-z])([A-Z])/g, "$1 $2")
.toLowerCase()}s`;

Expand Down

0 comments on commit 0d5b91a

Please sign in to comment.