Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Discord RPC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Reviath
Discord RPC
Commits
34d517fe
Commit
34d517fe
authored
Feb 9, 2021
by
Reviath
Browse files
Options
Downloads
Patches
Plain Diff
Fixed ram usage refresh
parent
3cbad083
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
resources/app/bot.js
+6
-2
6 additions, 2 deletions
resources/app/bot.js
resources/app/index.html
+0
-10
0 additions, 10 deletions
resources/app/index.html
with
6 additions
and
12 deletions
resources/app/bot.js
+
6
−
2
View file @
34d517fe
...
@@ -41,6 +41,11 @@ rpc.on('ready', () => {
...
@@ -41,6 +41,11 @@ rpc.on('ready', () => {
});
});
setInterval
(
function
(){
setInterval
(
function
(){
let
totalmem
=
os
.
totalmem
()
/
1024
/
1024
/
1000
;
let
freemem
=
os
.
freemem
()
/
1024
/
1024
/
1000
;
let
usedmem
=
totalmem
-
freemem
;
var
tmem
=
Math
.
floor
(
totalmem
);
var
umem
=
Math
.
floor
(
usedmem
);
rpc
.
setActivity
({
rpc
.
setActivity
({
details
:
`CPU:
${
os
.
cpus
().
map
(
i
=>
`
${
i
.
model
}
`
)[
0
]}
`
,
details
:
`CPU:
${
os
.
cpus
().
map
(
i
=>
`
${
i
.
model
}
`
)[
0
]}
`
,
state
:
`RAM:
${
umem
}
GiB/
${
tmem
}
GiB`
,
state
:
`RAM:
${
umem
}
GiB/
${
tmem
}
GiB`
,
...
@@ -54,5 +59,4 @@ rpc.on('ready', () => {
...
@@ -54,5 +59,4 @@ rpc.on('ready', () => {
});
});
},
15000
);
},
15000
);
});
});
console
.
log
(
'
RPC is ready!
'
)
rpc
.
login
({
clientId
,
clientSecret
});
rpc
.
login
({
clientId
,
clientSecret
});
This diff is collapsed.
Click to expand it.
resources/app/index.html
deleted
100644 → 0
+
0
−
10
View file @
3cbad083
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<title>
Presence
</title>
<body>
<h1>
Started RPC!
</h1>
<h2>
Don't quit this page
</h2>
</body>
</head>
</html>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment