Skip to content

Commit 87a44f7

Browse files
authored
Merge pull request #2 from Sobhan-SRZA/pull-reaquest
0.0.0
2 parents 90b2b64 + b30dcaa commit 87a44f7

File tree

14 files changed

+40
-29
lines changed

14 files changed

+40
-29
lines changed

dist/src/events/message/message.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/events/message/message.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/types/command.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example.env

+19-25
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,37 @@
1-
# Bot token.
2-
# Example: token="MTI5sYExDvhjJK5YxNjA0NDY5NQ.GvsdD5.7taYXjy1zVKDOxAIMc1pX2d_wt86SmCjWi9se556"
1+
# Bot token (required)
2+
# token="YOUR_TELEGRAM_BOT_TOKEN"
33
token=""
44

5-
# Choose one type for save users and guilds data. Types: "mysql" | "sql" | "mongodb" | "json"
6-
# Example: database_type="json"
5+
# Database type (required): options are "mysql" | "sql" | "mongodb" | "json"
6+
# database_type="json"
77
database_type=""
88

9-
# If you choose "mongodb" type place your mongo url.
10-
# Example: database_mongoURL="mongodb+srv://test:123456789@cluster0.b6grdg6.mongodb.net/?retryWrites=true&w=majority"
9+
# (Optional) If using MongoDB:
10+
# database_mongoURL="your-mongo-url"
1111
database_mongoURL=""
1212

13-
# If you choose "mysql" type place your Mysql server host name.
14-
# Example: database_msql_host="test"
13+
# (Optional) If using MySQL:
14+
# database_msql_host="your-mysql-host"
15+
# database_msql_user="your-mysql-user"
16+
# database_msql_password="your-mysql-password"
17+
# database_msql_database="your-mysql-database"
1518
database_msql_host=""
16-
17-
# If you choose "mysql" type place your Mysql server username.
18-
# Example: database_msql_user="test123"
1919
database_msql_user=""
20-
21-
# If you choose "mysql" type place your Mysql server password.
22-
# Example: database_msql_password="123456789"
2320
database_msql_password=""
24-
25-
# If you choose "mysql" type place your Mysql server database name.
26-
# Example: database_msql_database="database"
2721
database_msql_database=""
2822

29-
# Support server invite link.
30-
# Example: support_url="https://discord.gg/AfkuXgCKAQ"
23+
# Support server invite link (optional)
24+
# support_url="https://discord.gg/yourInvite"
3125
support_url=""
3226

33-
# Source owners.
34-
# Example: owners="["546464654564565", "88864545646467878"]"
27+
# Source owners (optional, comma-separated list of owner IDs)
28+
# owners='["123456789", "987654321"]'
3529
owners=""
3630

37-
# Source anti crash controller.
38-
# Example: anti_crash=true
31+
# Anti crash controller (optional)
32+
# anti_crash=true
3933
anti_crash=""
4034

41-
# Send console erros to discord.
42-
# Example: logger=true
35+
# Send console errors to Discord (optional)
36+
# logger=true
4337
logger=""

src/commands/Chats/activate_referral.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const command: CommandType = {
88
},
99
category: "chats",
1010
cooldown: 5,
11+
only_privet: true,
1112
run: async (client, ctx) => {
1213
try {
1314
const userId = ctx.from?.id;

src/commands/Chats/anon.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const command: CommandType = {
99
},
1010
category: "chats",
1111
cooldown: 5,
12+
only_privet: true,
1213
run: async (client, ctx) => {
1314
try {
1415
const userId = ctx.from?.id;

src/commands/Chats/myprofile.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const command: CommandType = {
1010
},
1111
category: "chats",
1212
cooldown: 5,
13+
only_privet: true,
1314
run: async (client, ctx) => {
1415
try {
1516
const

src/commands/Chats/random.ts

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const command: CommandType = {
1010
},
1111
category: "chats",
1212
cooldown: 5,
13+
only_privet: true,
1314
run: async (client, ctx, args) => {
1415
try {
1516
const

src/commands/Chats/setprofile.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const command: CommandType = {
99
},
1010
category: "chats",
1111
cooldown: 5,
12+
only_privet: true,
1213
run: async (client, ctx) => {
1314
try {
1415
return await ctx.reply(

src/commands/Chats/start.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ const command: CommandType = {
1010
},
1111
category: "chats",
1212
cooldown: 5,
13+
only_privet: true,
1314
run: async (client, ctx) => {
1415
try {
15-
16-
1716
const userId = ctx.from?.id;
1817
if (!userId)
1918
return;

src/commands/Chats/stop.ts

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const command: CommandType = {
99
},
1010
category: "chats",
1111
cooldown: 5,
12+
only_privet: true,
1213
run: async (client, ctx) => {
1314
try {
1415
const userId = ctx.from?.id;

src/events/Message/message.ts

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const event: EventType = {
4444
if (!command && message.chat.type === "private")
4545
return await message.sendMessage("⚠دستور تعریف نشده!");
4646

47+
// Filter Privet Commands
48+
if (command.only_privet && message.chat.type !== "private")
49+
return;
50+
4751
// Filter Group Commands
4852
if (command.only_group && await checkMember(message))
4953
return;

src/events/message/message.ts

+4
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ const event: EventType = {
4444
if (!command && message.chat.type === "private")
4545
return await message.sendMessage("⚠دستور تعریف نشده!");
4646

47+
// Filter Privet Commands
48+
if (command.only_privet && message.chat.type !== "private")
49+
return;
50+
4751
// Filter Group Commands
4852
if (command.only_group && await checkMember(message))
4953
return;

src/types/command.ts

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export default interface CommandType {
1717
only_owner?: boolean;
1818
only_group?: boolean;
1919
only_admins?: boolean;
20+
only_privet?: boolean;
2021
run: (client: TelegramClient, ctx: NarrowedContext<MyContext, Update.MessageUpdate<Message>>, args: string[]) => void;
2122
}
2223

0 commit comments

Comments
 (0)