Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Weasht
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
Emir Hamza
Weasht
Commits
5ea35af6
Commit
5ea35af6
authored
Jan 23, 2021
by
Reviath
Browse files
Options
Downloads
Patches
Plain Diff
Update commands/mute.js, commands/oylama.js files
parent
904f4865
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
commands/mute.js
+51
-3
51 additions, 3 deletions
commands/mute.js
commands/oylama.js
+1
-1
1 addition, 1 deletion
commands/oylama.js
with
52 additions
and
4 deletions
commands/mute.js
+
51
−
3
View file @
5ea35af6
...
...
@@ -2,11 +2,13 @@ const Discord = require('discord.js');
const
ms
=
require
(
"
ms
"
);
exports
.
run
=
async
(
client
,
message
,
args
)
=>
{
var
sql
=
`SELECT dil FROM guilds WHERE guildid='
${
guildid
}
'`
;
connection
.
query
(
sql
,
function
(
err
,
result
)
{
if
(
result
==
"
tr
"
){
if
(
!
message
.
member
.
hasPermission
(
"
MANAGE_ROLES
"
))
return
message
.
reply
(
"
Yeterli yetkiye sahip değilsin
"
);
let
spammer
=
message
.
guild
.
member
(
message
.
mentions
.
users
.
first
()
||
message
.
guild
.
members
.
cache
.
get
(
args
[
0
]));
if
(
!
spammer
)
return
message
.
channel
.
send
(
"
Bir üye belirtmelisin
"
);
if
(
!
message
.
member
.
hasPermission
(
"
MANAGE_ROLES
"
))
return
message
.
reply
(
"
Yeterli yetkiye sahip değilsin
"
);
let
role
=
message
.
guild
.
roles
.
cache
.
find
(
r
=>
r
.
name
===
"
Muted
"
);
if
(
spammer
.
id
==
message
.
author
.
id
)
return
message
.
channel
.
send
(
'
Kendine mute atamazsın!
'
);
if
(
!
role
){
...
...
@@ -47,6 +49,52 @@ exports.run = async(client, message, args) => {
spammer
.
roles
.
remove
(
role
.
id
);
message
.
channel
.
send
(
`<@
${
spammer
.
id
}
> tekrar konuşabilir`
);
},
ms
(
time
));
}
else
{
if
(
!
message
.
member
.
hasPermission
(
"
MANAGE_ROLES
"
))
return
message
.
reply
(
"
You don't have enough permission
"
);
let
spammer
=
message
.
guild
.
member
(
message
.
mentions
.
users
.
first
()
||
message
.
guild
.
members
.
cache
.
get
(
args
[
0
]));
if
(
!
spammer
)
return
message
.
channel
.
send
(
"
You need to specify a user
"
);
let
role
=
message
.
guild
.
roles
.
cache
.
find
(
r
=>
r
.
name
===
"
Muted
"
);
if
(
spammer
.
id
==
message
.
author
.
id
)
return
message
.
channel
.
send
(
'
You can
\'
t mute yourself
'
);
if
(
!
role
){
try
{
role
=
await
message
.
guild
.
roles
.
create
({
data
:{
name
:
"
Muted
"
,
color
:
"
#818080
"
,
permissions
:[]}
})
message
.
guild
.
channels
.
cache
.
forEach
(
async
(
channel
,
id
)
=>
{
await
channel
.
updateOverwrite
(
role
,
{
SEND_MESSAGES
:
false
,
ADD_REACTIONS
:
false
});
});
}
catch
(
e
){
client
.
channels
.
cache
.
get
(
'
790640302452375562
'
).
send
(
`Error on mute command \n
${
e
}
`
)
};
}
if
(
spammer
.
roles
.
cache
.
has
(
role
.
id
))
return
message
.
channel
.
send
(
'
This user is muted!
'
);
let
time
=
args
[
1
];
if
(
!
time
)
{
time
=
"
24h
"
};
let
reason
=
args
.
slice
(
2
).
join
(
'
'
);
if
(
!
reason
)
{
reason
=
"
Unspecified
"
}
await
(
spammer
.
roles
.
add
(
role
.
id
));
await
message
.
channel
.
send
(
`Muted user: <@
${
spammer
.
id
}
> \nTime:
\`
${
ms
(
ms
(
time
))}
\`
\nReason:
\`
${
reason
}
\`
`
);
setTimeout
(
function
()
{
if
(
!
spammer
.
roles
.
cache
.
has
(
role
.
id
))
return
;
spammer
.
roles
.
remove
(
role
.
id
);
message
.
channel
.
send
(
`<@
${
spammer
.
id
}
> can speak again`
);
},
ms
(
time
));
}
});
};
module
.
exports
.
help
=
{
...
...
This diff is collapsed.
Click to expand it.
commands/oylama.js
+
1
−
1
View file @
5ea35af6
...
...
@@ -17,6 +17,6 @@ const Discord = require('discord.js');
};
module
.
exports
.
help
=
{
name
:
'
oylama
'
,
aliases
:
[]
aliases
:
[
'
vote
'
]
};
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