Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sanae
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
Levatax
Sanae
Commits
88f9e97f
Commit
88f9e97f
authored
Sep 28, 2020
by
Levatax
Browse files
Options
Downloads
Patches
Plain Diff
Added kick command
parent
934a3f4b
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/kick.js
+34
-0
34 additions, 0 deletions
commands/kick.js
with
34 additions
and
0 deletions
commands/kick.js
0 → 100644
+
34
−
0
View file @
88f9e97f
const
Discord
=
require
(
'
discord.js
'
);
exports
.
run
=
async
(
bot
,
message
,
args
,
connection
)
=>
{
let
user
=
message
.
guild
.
member
(
message
.
mentions
.
users
.
first
()
||
message
.
guild
.
members
.
get
(
args
[
0
]));
let
reason
=
args
.
slice
(
1
).
join
(
'
'
);
if
(
!
user
)
return
message
.
channel
.
send
(
'
Please mention user to kick.
'
);
if
(
!
reason
)
return
message
.
channel
.
send
(
'
Please type a reason and try again
'
);
if
(
!
message
.
guild
.
member
(
user
).
kickable
)
return
message
.
reply
(
`I don't have permission to kick this user`
);
console
.
log
(
user
.
user
.
tag
);
user
.
kick
({
reason
:
reason
});
const
embed
=
new
Discord
.
RichEmbed
()
.
setColor
(
'
RANDOM
'
)
.
setTimestamp
()
.
addField
(
'
Punishment:
'
,
'
Kick From Server
'
)
.
addField
(
'
Kicked User:
'
,
`
${
user
.
user
.
tag
}
(
${
user
.
id
}
)`
)
.
addField
(
'
Moderator:
'
,
`
${
message
.
author
.
tag
}
(
${
message
.
author
.
id
}
)`
)
.
addField
(
'
Reason:
'
,
reason
);
message
.
channel
.
send
(
embed
);
var
sql
=
`INSERT INTO punishments (type,guild,user,admin,duration,reason,channel) VALUES ('Kick','
${
message
.
guild
.
id
}
','
${
user
.
id
}
','
${
message
.
member
.
id
}
','-','
${
reason
}
','
${
message
.
channel
.
id
}
')`
;
connection
.
query
(
sql
,
function
(
err
,
result
)
{
if
(
err
)
throw
err
;
console
.
log
(
'
successfully added to sql
'
);
});
};
module
.
exports
.
help
=
{
name
:
'
kick
'
,
aliases
:
[
''
]
};
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