Skip to content

Commit 160d2d0

Browse files
committed
feat(types): add command and response type definitions
- Added `RoastMessages` and `RepliedMessage` interfaces in `CommandTypes.ts` for handling roast message logic and replied messages. - Added `DatabaseConfig`, `BotConfig`, `ErrorResponse`, and `RateLimitEntry` interfaces in `ResponseTypes.ts` for database configuration, bot configuration, error handling, and rate-limiting.
1 parent 938dbfb commit 160d2d0

2 files changed

Lines changed: 38 additions & 0 deletions

File tree

src/types/CommandTypes.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Chat, User } from "grammy/types";
2+
3+
export interface RoastMessages {
4+
replyToUser: string[];
5+
notReplyingToAnyone: string[];
6+
replyToBot: string[];
7+
}
8+
export interface RepliedMessage {
9+
message_id: number;
10+
from?: User;
11+
chat: Chat;
12+
date: number;
13+
message_thread_id?: number;
14+
text?: string;
15+
}

src/types/ResponseTypes.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export interface DatabaseConfig {
2+
user: string;
3+
host: string;
4+
databaseName: string;
5+
password: string;
6+
port: number;
7+
url: string;
8+
}
9+
10+
export interface BotConfig {
11+
token: string;
12+
environment: 'development' | 'production';
13+
database: DatabaseConfig;
14+
}
15+
export interface ErrorResponse {
16+
message: string;
17+
statusCode: number;
18+
category: string;
19+
}
20+
export interface RateLimitEntry {
21+
lastCommandTime: number;
22+
commandCount: number;
23+
}

0 commit comments

Comments
 (0)