Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
59e26b28
authored
2024-09-09 17:21:52 +0800
by
Jonille Arreglo
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
31466_limited_usage_chatbot+
1 parent
80f3ea39
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
index.js
index.js
View file @
59e26b2
...
...
@@ -435,12 +435,13 @@ async function validation (aiwp_app_id, req, res) {
res
.
json
({
status
:
"invalid"
,
restrict
:
true
,
redirect
:
auth
.
redirect
});
res
.
end
();
return
false
;
}
else
if
(
typeof
auth
.
has_pro_access
===
"undefined"
&&
!
auth
.
has_pro_access
)
{
}
else
if
(
auth
.
subscription_type
&&
typeof
auth
.
has_pro_access
===
"undefined"
&&
!
auth
.
has_pro_access
)
{
res
.
json
({
status
:
"invalid"
,
restrict
:
true
});
res
.
end
();
return
false
;
}
}
}
else
{
let
data
=
await
getUsage
({
aiwp_logged_in
,
app
:
'chatbot+'
});
...
...
@@ -450,8 +451,11 @@ async function validation (aiwp_app_id, req, res) {
res
.
status
(
200
);
return
false
;
}
}
}
else
{
IS_FREE_USER
=
true
;
}
if
(
IS_FREE_USER
)
{
let
data
=
await
getLimitedUsage
({
"aiwp_app_id"
:
aiwp_app_id
});
...
...
@@ -459,14 +463,13 @@ async function validation (aiwp_app_id, req, res) {
if
(
data
.
usage
!==
null
)
{
TRIED_USAGE
=
parseInt
(
data
.
usage
);
}
}
if
(
IS_FREE_USER
&&
TRIED_USAGE
>=
limit
)
{
if
(
TRIED_USAGE
>=
limit
)
{
res
.
json
({
status
:
"invalid"
,
limited
:
true
});
res
.
end
();
return
false
;
}
if
(
IS_FREE_USER
)
TRIED_USAGE
++
;
TRIED_USAGE
++
;
}
return
{
IS_FREE_USER
,
aiwp_logged_in
,
TRIED_USAGE
};
};
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment