├── LICENSE ├── Procfile ├── config.json ├── keivegas.js └── package.json /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 keixyz 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | worker node keivegas.js 2 | -------------------------------------------------------------------------------- /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "Bot": { 3 | "Token": "", 4 | "Owners": [], 5 | "Prefix": ["!", ".", "r!"], 6 | "Durum": "", 7 | "Status": "" 8 | }, 9 | 10 | "Server": { 11 | "GuildID": "" 12 | }, 13 | 14 | "Channels": { 15 | "VoiceChannelID": "" 16 | }, 17 | 18 | "Roles": { 19 | "VK": "", 20 | "DC": "", 21 | "GoLive": "" 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /keivegas.js: -------------------------------------------------------------------------------- 1 | const discord = require('discord.js'); 2 | const client = new discord.Client(); 3 | const disbut = require('discord-buttons')(client); 4 | const cfg = require("./config.json"); 5 | 6 | client.on("message", async (msg) => { 7 | let prefix = cfg.Bot.Prefix.find((x) => msg.content.toLowerCase().startsWith(x)); 8 | if (msg.content !== ""+prefix+"button" && msg.content !== ""+prefix+"buttons") return; 9 | if(!cfg.Bot.Owners.includes(msg.author.id) && !msg.guild.owner.user.id.includes(msg.author.id)) return 10 | 11 | let VK = new disbut.MessageButton() 12 | .setStyle('red') 13 | .setLabel('Vampir Köylü') 14 | .setID('VK') 15 | let DC = new disbut.MessageButton() 16 | .setStyle('gray') 17 | .setLabel('Doğruluk Cesaret') 18 | .setID('DC') 19 | 20 | let GoLive = new disbut.MessageButton() 21 | .setStyle("green") 22 | .setLabel('Go Live') 23 | .setID('GoLive') 24 | 25 | msg.channel.send(` 26 | Selam sunucumuzda eğlence rolleri bulunmaktadır. Aşağıda ki tepkilere basarak ilgilendiğiniz eğlence rolünüzü alabilirsiniz. **İyi Eğlenceler.** 27 | 28 | \`Eğlence rolleri;\` 29 | 30 | \`>\` <@&${cfg.Roles.VK}> 31 | 32 | \`>\` <@&${cfg.Roles.DC}> 33 | 34 | \`>\` <@&${cfg.Roles.GoLive}> 35 | 36 | Sunucumuzda her akşam çeşitli etkinlikler olucağı için rolünüzü almayı unutmayınız. 37 | `, { 38 | buttons: [DC, VK, GoLive] 39 | }) 40 | 41 | }) 42 | client.on('clickButton', async (button) => { 43 | 44 | if (button.id === 'VK') { 45 | if (button.clicker.member.roles.cache.get(cfg.Roles.VK)) { 46 | await button.clicker.member.roles.remove(cfg.Roles.VK) 47 | await button.think(true); 48 | await button.reply.edit("Vampir Köylü rolü üzerinizden alındı.") 49 | } else { 50 | await button.clicker.member.roles.add(cfg.Roles.VK) 51 | await button.think(true); 52 | await button.reply.edit("Vampir Köylü rolü üzerinize verildi.") 53 | } 54 | } 55 | if (button.id === 'DC') { 56 | if (button.clicker.member.roles.cache.get(cfg.Roles.DC)) { 57 | await button.clicker.member.roles.remove(cfg.Roles.DC) 58 | await button.think(true); 59 | await button.reply.edit("Doğruluk Cesaret rolü üzerinizden alındı.") 60 | } else { 61 | await button.clicker.member.roles.add(cfg.Roles.DC) 62 | await button.think(true); 63 | await button.reply.edit("Doğruluk Cesaret rolü üzerinize verildi.") 64 | }} 65 | if (button.id === 'GoLive') { 66 | if (button.clicker.member.roles.cache.get(cfg.Roles.GoLive)) { 67 | await button.clicker.member.roles.remove(cfg.Roles.GoLive) 68 | await button.think(true); 69 | await button.reply.edit("GoLive rolü üzerinizden alındı.") 70 | } else { 71 | await button.clicker.member.roles.add(cfg.Roles.GoLive) 72 | await button.think(true); 73 | await button.reply.edit("GoLive rolü üzerinize verildi.") 74 | } 75 | 76 | } 77 | 78 | }) 79 | 80 | 81 | 82 | client.on('ready', async () => { 83 | 84 | client.user.setPresence({ activity: { name: cfg.Bot.Durum }, status: cfg.Bot.Status }) 85 | let VoiceChannelID = client.channels.cache.get(cfg.Channels.VoiceChannelID) 86 | if (VoiceChannelID) VoiceChannelID.join().catch(() => { }) 87 | console.log(`(${client.user.username}) adlı hesapta [${client.guilds.cache.get(cfg.Server.GuildID).name}] adlı sunucuda giriş yapıldı. ✔`) 88 | 89 | }); 90 | 91 | client.login(cfg.Bot.Token).catch(() => console.error("Bota giriş yapılırken başarısız olundu!")); -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "keivegas.js", 3 | "dependencies": { 4 | "discord-buttons": "^2.4.1", 5 | "discord.js": "^12.5.3" 6 | }, 7 | "scripts": { 8 | "test": "keivegas.js" 9 | } 10 | } 11 | --------------------------------------------------------------------------------