├── README.md
└── buttonmute.js
/README.md:
--------------------------------------------------------------------------------
 1 | # Discord-Button-Mute
 2 | 
 3 | 
 4 | Selam arkadaşlar buraya bazı yerlerde gördüğüm istenen butonlu bir mute  komut dosyası bırakıyorum gerekli yerleri kafanıza göre editler yada row vs. ekleyerek butonları arttırabilirsiniz
 5 | 
 6 |  
 7 | 
 8 | 
 9 | Proje içi exports vs uye tanım kısımları üstteki return mesajları vb. kendi botunuza göre düzenleyebilirsiniz aynı şekilde click button kısımları örnek olarak verildi ki nasıl yapıldğını görebilesiniz diye ordan yola çıkarak devam edebilirsiniz kolay gelsin ^^
10 | 
11 | 
12 | 
13 | 
14 | 
15 | 
16 | • Diğer Butonlu Bir Projem Olan Butonlu Menüyü Görmek İçin = https://github.com/Cennk/Discord-buton-menu
17 | 
--------------------------------------------------------------------------------
/buttonmute.js:
--------------------------------------------------------------------------------
  1 | 
  2 | module.exports.operate = async ({client, msg, args, author, uye, cfg}, ms = require("ms"), Discord = require("discord.js"), Database = require("../models/Ceza.js")) => {
  3 |     const { MessageActionRow, MessageButton } = require('discord-buttons')
  4 |     const { MessageEmbed } = require("discord.js");
  5 |     const moment = require("moment");
  6 | 
  7 |     let Sayi = 0;
  8 |     client.komutSayisiArttir({Database: require("../models/Member.js"), msg: msg, sayi: 1, type: "cmute"});
  9 |     new Database({CezaID: Sayi, Type: "MUTE", userID: uye.id, Author: author.id, Reason: reason, DateNow: new Date(), Activity: true, Temporary: true}).save();
 10 | 
 11 |     if ((!author.roles.cache.some(r => cfg.hammers.voiceMuteHammer.includes(r.id))) && (!author.hasPermission("MANAGE_ROLES"))) return client.message(client.yetersizEmbed(msg), msg.channel.id, 5000);
 12 |     if (!uye) return client.message(client.uyeEmbed(msg), msg.channel.id, 5000);
 13 |     if (author.roles.highest.position <= uye.roles.highest.position) return client.message(client.yetersizYetki("Bu kişi senden `yüksek` veya `aynı` yetkiye sahip olduğu için susturamazsın.", msg), msg.channel.id, 5000);
 14 | 
 15 | 
 16 | 
 17 |     let button1 = new MessageButton()
 18 |     .setStyle('blurple')
 19 |     .setLabel('1') 
 20 |     .setID('ceza1') 
 21 |   let button2 = new MessageButton()
 22 |     .setStyle('blurple')
 23 |     .setLabel('2') 
 24 |     .setID('ceza2') 
 25 | 
 26 |     let button3 = new MessageButton()
 27 |     .setStyle('blurple')
 28 |     .setLabel('3') 
 29 |     .setID('ceza3') 
 30 |   
 31 |     let button4= new MessageButton()
 32 |     .setStyle('blurple')
 33 |     .setLabel('4') 
 34 |     .setID('ceza4') 
 35 |   
 36 |     let button5 = new MessageButton()
 37 |     .setStyle('blurple')
 38 |     .setLabel('5') 
 39 |     .setID('ceza5') 
 40 | 
 41 |     let button6 = new MessageButton()
 42 |     .setStyle('blurple')
 43 |     .setLabel('6') 
 44 |     .setID('ceza6') 
 45 | 
 46 |     let button7 = new MessageButton()
 47 |     .setStyle('blurple')
 48 |     .setLabel('7') 
 49 |     .setID('ceza7') 
 50 | 
 51 |     let button8 = new MessageButton()
 52 |     .setStyle('blurple')
 53 |     .setLabel('8') 
 54 |     .setID('ceza8') 
 55 | 
 56 |     let button9 = new MessageButton()
 57 |     .setStyle('blurple')
 58 |     .setLabel('9') 
 59 |     .setID('ceza9')
 60 | 
 61 |     let button10 = new MessageButton()
 62 |     .setStyle('red')
 63 |     .setLabel('X') 
 64 |     .setID('ceza10')
 65 |   
 66 |     const ef = new MessageActionRow()
 67 |     .addComponents(button1,button2,button3,button4,button5)
 68 |     const ef2 = new MessageActionRow()
 69 |     .addComponents(button6,button7,button8,button9,button10)
 70 | 
 71 |     let mesaj = await msg.channel.send(`${uye} (\`${uye.id}\`) için cezalandırma menüsü:
 72 |     
 73 | 
 74 |     **1)** Ailevi Küfür - 20 dakika
 75 |     **2)** Küfür - 10 dakika
 76 |     **3)** Flood / Spam - 10 dakika
 77 |     **4)** Tartışma / Kavga - 15 dakika
 78 |     **5)** Ortam Bozma / Rahatsızlık Verme - 10 dakika 
 79 | 
 80 |     **6)** Sunucuyu Kötülemek - 30 dakika 
 81 |     **7)** Manevi Değerlere Küfür / Hakaret - 90 dakika
 82 |     **8)** Kadın Üyelere Sarkmak - 20 dakika
 83 |     **9)** Siyaset - 20 dakika
 84 |            
 85 |       `,{components:[ef,ef2]})
 86 |       var filter = (button) => button.clicker.user.id === msg.author.id;
 87 |       let collector = await mesaj.createButtonCollector(filter) 
 88 |       collector.on('collect', async (button) => {
 89 |         if (button.id === "ceza1") {
 90 |           uye.roles.add(cfg.cezaliRoller.muteRoles);
 91 |           const reason = `Ailevi Küfür`
 92 |           const Sure = ms('20m')
 93 |           if (cfg.cezaliRoller.muteRoles !== "") await uye.roles.add(cfg.cezaliRoller.muteRoles).catch();
 94 |           button.reply.defer()
 95 |           msg.channel.send(`${uye} kişisi **1 dakika** boyunca tarafından chat kanalları üzerinden susturuldu \`(Ceza ID: #${Sayi})\``)
 96 |             .then(msg.delete({ timeout: 1500 })).then((x) => x.delete({ timeout: 5000 })); 
 97 |   
 98 |             const log = new MessageEmbed()
 99 |       .setAuthor( author.displayName, msg.author.avatarURL({dynamic: true}))
100 |       .setColor("RANDOM")
101 |       .setDescription(
102 | `${uye} kişisi **${reason}** sebebiyle **${`${client.format(ms(Sure))}`.replace(", 0 saniye", "").trimEnd()}** chat kanallarında susturuldu. 
103 | ───────────────
104 | Mute Atılma Tarihi: **${client.toDate(new Date(Date.now()))}**
105 |       `);
106 |     msg.guild.channels.cache.get(cfg.log.mute).send(log);
107 | 
108 | }
109 | 
110 | 
111 | 
112 | 
113 | 
114 | 
115 | 
116 | //**${moment(Date.now() + Sure).format("LLL")}**
117 | 
118 | 
119 | 
120 | 
121 | 
122 | if (button.id === "ceza2") {
123 |     member.roles.add(cfg.cezaliRoller.muteRoles);
124 |     const reason = `Küfür`
125 |     const Sure = ms('10m')
126 |     button.reply.defer()
127 |   msg.channel.send(`${uye} üyesi, ${author} tarafından, \`${reason}\` nedeniyle susturuldu! \`(Ceza ID: #${Sayi})\``)
128 |     .then(msg.delete({ timeout: 1500 })).then((x) => x.delete({ timeout: 5000 })); 
129 | 
130 | 
131 |     const log = new MessageEmbed()
132 |     .setAuthor( author.displayName, icon_url, msg.author.avatarURL({dynamic: true}))
133 |     .setColor("RANDOM")
134 |     .setDescription(
135 | `${uye} kişisi **${reason}** sebebiyle **${`${client.format(ms(Sure))}`.replace(", 0 saniye", "").trimEnd()}** chat kanallarında susturuldu. 
136 | ───────────────
137 | Mute Atılma Tarihi: **${client.toDate(new Date(Date.now()))}**
138 | Mute Bitiş Tarihi: **${client.toDate(new Date(Date.now() + ms(Sure)))}**
139 |     `);
140 |     message.guild.channels.cache.get(cfg.log.mute).send(log);
141 | }
142 | 
143 | 
144 | 
145 | if (button.id === "ceza3") {
146 |     member.roles.add(cfg.cezaliRoller.muteRoles);
147 |   const reason = `Flood/Spam`
148 |   const Sure = ms('10m')
149 |   button.reply.defer()
150 |   msg.channel.send(`${uye} üyesi, ${author} tarafından, \`${reason}\` nedeniyle susturuldu! \`(Ceza ID: #${Sayi})\``)
151 |   .then(msg.delete({ timeout: 1500 })).then((x) => x.delete({ timeout: 5000 })); 
152 |   
153 |   
154 |   const log = new MessageEmbed()
155 |   .setAuthor( author.displayName, icon_url, msg.author.avatarURL({dynamic: true}))
156 |   .setColor("RANDOM")
157 |   .setDescription(
158 | `${uye} kişisi **${reason}** sebebiyle **${`${client.format(ms(Sure))}`.replace(", 0 saniye", "").trimEnd()}** chat kanallarında susturuldu. 
159 | ───────────────
160 | Mute Atılma Tarihi: **${client.toDate(new Date(Date.now()))}**
161 | Mute Bitiş Tarihi: **${client.toDate(new Date(Date.now() + ms(Sure)))}**
162 |   `);
163 |   message.guild.channels.cache.get(cfg.log.mute).send(log);
164 | 
165 | }
166 | 
167 | 
168 | 
169 | if (button.id === "ceza4") {
170 |     member.roles.add(cfg.cezaliRoller.muteRoles);
171 |   const reason = `Tartışma/Kavga`
172 |   const Sure = ms('15m')
173 | button.reply.defer()
174 | msg.channel.send(`${uye} üyesi, ${author} tarafından, \`${reason}\` nedeniyle susturuldu! \`(Ceza ID: #${Sayi})\``)
175 | .then(msg.delete({ timeout: 1500 })).then((x) => x.delete({ timeout: 5000 })); 
176 |   
177 |   const log = new MessageEmbed()
178 |   .setAuthor( author.displayName, icon_url, msg.author.avatarURL({dynamic: true}))
179 |   .setColor("RANDOM")
180 |   .setDescription(
181 | `${uye} kişisi **${reason}** sebebiyle **${`${client.format(ms(Sure))}`.replace(", 0 saniye", "").trimEnd()}** chat kanallarında susturuldu. 
182 | ───────────────
183 | Mute Atılma Tarihi: **${client.toDate(new Date(Date.now()))}**
184 | Mute Bitiş Tarihi: **${client.toDate(new Date(Date.now() + ms(Sure)))}**
185 |   `);
186 |   message.guild.channels.cache.get(cfg.log.mute).send(log);
187 | 
188 | 
189 |   if (button.id === "ceza10") {
190 |     button.reply.defer()
191 |     message.reply(`İşlem iptal edildi!`)
192 |       .then(msg.delete({ timeout: 1500 })).then((x) => x.delete({ timeout: 5000 })); 
193 |     }
194 | 
195 | }
196 |       } 
197 | 
198 |     
199 |     )};
200 |       
201 |       
202 | 
203 | module.exports.help = {
204 | name: "muteke",
205 | alias: []
206 | };
207 | 
--------------------------------------------------------------------------------