Skip to content

Commit 5b12b05

Browse files
committed
feat: "Updated .dockerignore, docker-compose.yml, package.json, and several TypeScript files in the src directory, including bot commands and utility files."
1 parent 0ab0424 commit 5b12b05

File tree

7 files changed

+11
-12
lines changed

7 files changed

+11
-12
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ dist
55
Dockerfile
66
*.md
77
tests
8-
__tests__
98
.git
109
.gitignore
1110
archive

docker-compose.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,18 @@ services:
1111
networks:
1212
- cop-net
1313
restart: unless-stopped
14+
ports:
15+
- "3000:3000"
1416

1517
db:
16-
image: postgres:16
18+
image: postgres:16
1719
container_name: cop-db
1820
environment:
19-
POSTGRES_PASSWORD: ${DB_PASSWORD}
21+
POSTGRES_PASSWORD: ${DB_PASSWORD}
2022
POSTGRES_DB: ${DB_NAME}
21-
POSTGRES_USER: ${DB_USER}
23+
POSTGRES_USER: ${DB_USER}
2224
volumes:
23-
- db-data:/var/lib/postgresql/data
25+
- db-data:/var/lib/postgresql/data
2426
networks:
2527
- cop-net
2628
restart: unless-stopped

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"docker:down": "docker-compose down",
1515
"docker:build": "docker-compose build",
1616
"docker:run": "docker-compose up",
17-
"docker:start": "docker-compose up --build",
17+
"docker:start": "docker-compose up --build -d",
18+
"docker:start:all": "npm run docker:build && npm run docker:start",
1819
"build": "tsc",
1920
"test": "mocha --config .mochar.json",
2021
"clean": "rm -rf dist",

src/bot/commands/admin/AdminCommands.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ Group Type: ${group?.type || 'Unknown'}
348348
}
349349
/** Pin Command */
350350
@RestrictToGroupChats()
351-
@ReplyToBot()
352351
@BotIsAdmin()
353352
@OnlyAdminsCanUse()
354353
@RequireReply()
@@ -362,7 +361,6 @@ Group Type: ${group?.type || 'Unknown'}
362361
await reply.textReply('The message has been pinned.');
363362
}
364363
@RestrictToGroupChats()
365-
@ReplyToBot()
366364
@BotIsAdmin()
367365
@OnlyAdminsCanUse()
368366
@RequireReply()
@@ -377,7 +375,6 @@ Group Type: ${group?.type || 'Unknown'}
377375
}
378376
/** Purge Command */
379377
@RestrictToGroupChats()
380-
@ReplyToBot()
381378
@BotIsAdmin()
382379
@OnlyAdminsCanUse()
383380
@RequireReply()

src/bot/commands/genearl/GeneralCommands.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { ChatInfo } from '../../../utils/chat/ChatInfo';
66
import { DateCommand } from '../../service/general/date';
77
import * as BotInfoJson from '../../../../docs/BotInfo.json';
88
import { ReplyToBot } from '../../../decorators/Bot';
9-
import { RestrictToGroupChats } from '../../../decorators/Context';
109
import { jokeMessage } from '../../../utils';
1110
/**
1211
* Reason for lowercase command names:
@@ -96,7 +95,7 @@ export class GeneralCommands {
9695
static async commands(ctx: Context) {
9796
const reply = new BotReply(ctx);
9897
const { commands } = GeneralCommands.getMessage(ctx);
99-
await reply.textReply(commands);
98+
await reply.htmlReply(commands);
10099
}
101100
@ReplyToBot()
102101
@Catch({

src/bot/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export class CopBot {
8383
logger.info(`Webhook server running on port ${port}`);
8484
await this._bot.api.setWebhook(webhookURL);
8585
const webhookInfo = await this._bot.api.getWebhookInfo();
86+
console.log(`Webhook Info: ${webhookInfo}`);
8687
logger.info(`Webhook set: ${webhookInfo.url}`);
8788
});
8889
await startBot(mode);

src/utils/jsons/botMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"gorup": "Hello! What can I do?"
2626
},
2727
"commands": {
28-
"private": "Use this command in a private chat to interact with the bot.",
28+
"private": "<b>Private Mode Commands</b><br><br><b>/start</b>: Start interacting with the bot and receive a welcome message.<br><b>/help</b>: Get assistance and see the list of available commands.<br><b>/commands</b>: List all commands of the bot.<br><b>/date</b>: Get the current date and time.<br><b>/joke</b>: Get a random joke.<br><b>/viewsupportcontact</b>: View support contact details.<br><b>/botinfo</b>: Get information about the bot.<br><b>/shahin</b>: Trigger Shahin-specific functionality.<br><b>/aran</b>: Trigger Aran-specific functionality.<br><b>/rules</b>: View the group rules.<br><b>/codetime</b>: Says a random word sarcastically or offensively to you or people in the group.<br><b>/future</b>: Get insights about the future.<br><b>/groupinfo</b>: View information about the group.<br><b>/report</b>: Report an issue or a user.<br><b>/cancel</b>: Cancel the current report.<br><b>/link</b>: Generate or view group links.<br><b>/adminlist</b>: View the list of group admins.<br><b>/grant</b>: Grant admin privileges to a user.<br><b>/revoke</b>: Revoke admin privileges from a user.<br><b>/pin</b>: Pin a message in the group.<br><b>/unpin</b>: Unpin the pinned message.<br><b>/purge</b>: Delete a range of messages.<br><b>/welcome</b>: Returns the current group welcome message.<br><b>/approved</b>: Approve a user for special privileges.<br><b>/disapproved</b>: Remove approval for a user.<br><b>/approvedlist</b>: View the list of approved users.<br><b>/ban</b>: Ban a user from the group.<br><b>/unban</b>: Unban a previously banned user.<br><b>/warn</b>: Issue a warning to a user.<br><b>/rmwarn</b>: Remove a warning from a user.<br><b>/warns</b>: Check warnings for a user.<br><b>/warnslist</b>: View the list of all warnings.<br><b>/mute</b>: Mute a user in the group.<br><b>/unmute</b>: Unmute a previously muted user.<br><b>/blacklist</b>: Add a word or phrase to the blacklist.<br><b>/abl</b>: Add multiple words to the blacklist.<br><b>/rmbl</b>: Remove a word or phrase from the blacklist.<br><b>/clrbl</b>: Clear the blacklist.",
2929
"public": "This command is only available in private chats. Please use it there."
3030
}
3131
}

0 commit comments

Comments
 (0)