Skip to content

Commit

Permalink
rename log types to make sense
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Nov 27, 2023
1 parent ed9ed73 commit 3265eb8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const errors = {
uncaughtException: "Uncaught Exception",
};

export type ActionsStr =
export type LogAction =
| "message"
| "slashCommand"
| "button"
Expand All @@ -59,7 +59,7 @@ export type ActionsStr =
| "guildMemberUpdate"
| "guildJoined";

export type Actions =
export type LogData =
| Message
| Guild
| ButtonInteraction
Expand All @@ -68,8 +68,8 @@ export type Actions =
| ModalSubmitInteraction;

export type Log = {
type: ActionsStr;
data: any;
type: LogAction;
data: any; // technically LogData but TS breaks without this
};

/**
Expand All @@ -83,7 +83,7 @@ export class ExtendedClient<Ready extends boolean = boolean> extends Client<Read
public readonly tokens: Tokens;
public readonly automation = new Automation(this);

private logs: Log[] = [];
private readonly logs: Log[] = [];
private maxLogs = 50;
private lastLogIndex = 0;

Expand Down Expand Up @@ -344,7 +344,7 @@ export class ExtendedClient<Ready extends boolean = boolean> extends Client<Read
* @param type
* @param data
*/
public storeAction(type: ActionsStr, data: Actions): void {
public storeAction(type: LogAction, data: LogData): void {
this.logs[this.lastLogIndex++ % this.maxLogs] = { type, data };
}

Expand Down

0 comments on commit 3265eb8

Please sign in to comment.