Skip to content

Commit 76ba3d1

Browse files
committed
Some changes
1 parent 3599a0e commit 76ba3d1

File tree

5 files changed

+76
-29
lines changed

5 files changed

+76
-29
lines changed

app/actions/commands/start.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,20 @@ module.exports = {
1010
...ctx.from
1111
})
1212

13-
ctx.scene.enter('user-home')
13+
const isSubscribed = await BotSettigs.isSubscribed(ctx)
14+
15+
if(isSubscribed){
16+
ctx.scene.enter('user-home')
17+
} else {
18+
ctx.scene.enter('subscription')
19+
}
20+
21+
// ctx.scene.enter('user-home')
1422

1523
// Users.get(ctx.from.id)
1624
// .then( async user => {
1725
// if(user){
18-
// ctx.session.LANG = user.language
26+
// ctx.session.LANG = 'uz'
1927

2028
// if(BotSettigs.isOwner(ctx.from.id) || BotSettigs.isAdmin(ctx.from.id)){
2129
// ctx.scene.enter('user-home')
@@ -30,18 +38,7 @@ module.exports = {
3038
// }
3139
// } else {
3240
// ctx.session.LANG = 'uz'
33-
// // Kimdir referal orqali ro'yxatdan o'tayotgan bo'lsa,
34-
// // referal id olinadi
35-
// const referalId = ctx.message.text ? ctx.message.text.split(' ')[1] : undefined
36-
// if(referalId){
37-
// Users.get(referalId)
38-
// .then( async user => {
39-
// if(user){ ctx.session.referalId = referalId }
40-
// })
41-
// }
42-
43-
// ctx.scene.enter('signup')
44-
41+
// ctx.scene.enter('signup')
4542
// }
4643
// })
4744
}

app/database/config/index.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"startTime":null,"stopTime":null,"tempPath":"C:\\Users\\CraDev\\Desktop\\test\\app\\database\\temp","partnerChannels":[],"owners":[792684458],"admins":[5174234463],"stopCount":4}
1+
{"startTime":null,"stopTime":null,"tempPath":"C:\\Users\\CraDev\\Desktop\\business-incubator\\app\\database\\temp","partnerChannels":[-1001582421086],"owners":[792684458],"admins":[5174234463],"stopCount":4}
204 Bytes
Binary file not shown.

app/database/temp/session.json

Lines changed: 63 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@
9595
"id": "792684458:792684458",
9696
"data": {
9797
"__scenes": {
98-
"current": "fname",
98+
"current": "admin-partnerChannel",
9999
"state": {}
100100
},
101101
"LANG": "uz",
102-
"signup_user": {},
102+
"signup_user": null,
103103
"currentSceneMsg": {
104-
"message_id": 2357,
104+
"message_id": 2925,
105105
"from": {
106106
"id": 5227363417,
107107
"is_bot": true,
@@ -113,32 +113,81 @@
113113
"first_name": "Mohirbek",
114114
"type": "private"
115115
},
116-
"date": 1646925629,
117-
"text": "Asosiy menyu:",
116+
"date": 1647062118,
117+
"text": "Hamkor kanal qo'shish uchun undagi ixtiyoriy postni 'forward' qilib shu yerga jo'nating!\n\nEslatma! Hamkorga aylanish uchun bot kanalda adminlik huquqlariga ega bo'lishi kerak!",
118+
"entities": [
119+
{
120+
"offset": 90,
121+
"length": 85,
122+
"type": "italic"
123+
}
124+
],
118125
"reply_markup": {
119126
"inline_keyboard": [
120127
[
121128
{
122-
"text": "📢 Hamkor kanal",
123-
"callback_data": "admin.home.partnerChannel"
129+
"text": "Mohirbek | Blog",
130+
"url": "https://t.me/mohirbek_blog"
131+
},
132+
{
133+
"text": "✖️",
134+
"callback_data": "admin.partner_channel.del--0"
124135
}
125136
],
126137
[
127138
{
128-
"text": "📊 Statistika",
129-
"callback_data": "admin.home.stat"
139+
"text": "⬅️ Orqaga",
140+
"callback_data": "admin.partner_channel.back"
130141
}
131-
],
142+
]
143+
]
144+
}
145+
}
146+
}
147+
},
148+
{
149+
"id": "-1001582421086:792684458",
150+
"data": {
151+
"__scenes": {}
152+
}
153+
},
154+
{
155+
"id": "1954122373:1954122373",
156+
"data": {
157+
"__scenes": {
158+
"current": "subscription",
159+
"state": {}
160+
},
161+
"LANG": "uz",
162+
"signup_user": null,
163+
"currentSceneMsg": {
164+
"message_id": 2933,
165+
"from": {
166+
"id": 5227363417,
167+
"is_bot": true,
168+
"first_name": "Telegrafo",
169+
"username": "telegrafo_bot"
170+
},
171+
"chat": {
172+
"id": 1954122373,
173+
"first_name": ".",
174+
"username": "afifaqiz",
175+
"type": "private"
176+
},
177+
"date": 1647062151,
178+
"text": "Loyiha kanal bilan uzviy bog'liq. Iltimos, obuna bo'ling. Undan so'ng, [✅ A'zo bo'ldim] tugmasini bosib botdan foydalanishda davom etishingiz mumkin.",
179+
"reply_markup": {
180+
"inline_keyboard": [
132181
[
133182
{
134-
"text": "💾 Ma'lumotlarni yuklash",
135-
"callback_data": "admin.home.getDB"
183+
"text": "Mohirbek | Blog",
184+
"url": "https://t.me/mohirbek_blog"
136185
}
137186
],
138187
[
139188
{
140-
"text": "📣 Reklama tarqatish",
141-
"callback_data": "admin.home.publishAd"
189+
"text": "✅ A'zo bo'ldim",
190+
"callback_data": "user.subscription.agree"
142191
}
143192
]
144193
]

app/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { Constants } = require('./tools')
33
const { middlewares, commands, updates, startup } = require('./actions')
44

55
// const TOKEN = `5021272526:AAHDOwFxI4N0Sl3V8gOg-FutyZmKKhsh0vw`
6+
67
const TOKEN = `5111219626:AAE1p8p0kh1wFccJq-Tmf0b9VVLUVx3ktkc`
78
// 5174234463
89
// const TOKEN = Constants.TEST_TOKEN

0 commit comments

Comments
 (0)