Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Koakuma
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
Koakuma
Commits
170e4df3
Commit
170e4df3
authored
Jan 21, 2021
by
Reviath
Browse files
Options
Downloads
Patches
Plain Diff
Update commands/slots.js
parent
ce846742
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
commands/slots.js
+19
-4
19 additions, 4 deletions
commands/slots.js
with
19 additions
and
4 deletions
commands/slots.js
+
19
−
4
View file @
170e4df3
const
db
=
require
(
'
quick.db
'
);
const
Discord
=
require
(
'
discord.js
'
);
exports
.
run
=
async
(
client
,
message
,
args
)
=>
{
...
...
@@ -5,8 +6,23 @@ let slots = ["<a:blue_fire:801857759989465170>", "<a:orange_fire:801858052163895
let
result1
=
Math
.
floor
((
Math
.
random
()
*
slots
.
length
));
let
result2
=
Math
.
floor
((
Math
.
random
()
*
slots
.
length
));
let
result3
=
Math
.
floor
((
Math
.
random
()
*
slots
.
length
));
let
name
=
message
.
author
.
username
;
let
icon
=
message
.
author
.
avatarURL
();
let
number
=
args
[
0
];
let
bal
=
await
db
.
get
(
`Balance_
${
message
.
author
.
id
}
`
);
if
(
number
>
bal
||
number
<=
0
||
!
bal
)
return
message
.
channel
.
send
(
`Your balance is under the value you entered.`
)
let
cfNumber
;
if
(
!
number
)
return
message
.
channel
.
send
(
'
Please specify an amout to use.
'
);
if
(
number
>
50000
||
number
==
"
all
"
)
{
if
(
50000
>
bal
){
cfNumber
=
bal
;
}
else
{
cfNumber
=
50000
;
}
}
else
{
cfNumber
=
number
;
};
if
(
slots
[
result1
]
===
slots
[
result2
]
&&
slots
[
result1
]
===
slots
[
result3
])
{
let
embed
=
new
Discord
.
MessageEmbed
()
...
...
@@ -14,15 +30,14 @@ let slots = ["<a:blue_fire:801857759989465170>", "<a:orange_fire:801858052163895
.
setTitle
(
'
:slot_machine: Slots :slot_machine:
'
)
.
addField
(
'
Result:
'
,
slots
[
result1
]
+
slots
[
result2
]
+
slots
[
result3
],
true
)
.
setColor
(
0xF4E842
)
message
.
channel
.
send
(
embed
);
message
.
channel
.
send
(
embed
).
then
(
db
.
add
(
`
${
message
.
author
.
id
}
`
,
cfNumber
));
}
else
{
let
embed2
=
new
Discord
.
MessageEmbed
()
.
setFooter
(
'
You lost!
'
,
icon
)
.
setTitle
(
'
:slot_machine: Slots :slot_machine:
'
)
.
addField
(
'
Result:
'
,
slots
[
result1
]
+
slots
[
result2
]
+
slots
[
result3
],
true
)
.
setColor
(
0xF4E842
)
message
.
channel
.
send
(
embed2
);
message
.
channel
.
send
(
embed2
)
.
then
(
db
.
subtract
(
`
${
message
.
author
.
id
}
`
,
cfNumber
))
;
}
}
module
.
exports
.
help
=
{
...
...
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