├── .env.example ├── package.json ├── README.md └── index.js /.env.example: -------------------------------------------------------------------------------- 1 | BOT_TOKEN= 2 | CHANNEL_ID= 3 | MODE= 4 | DELAY=15000 5 | DEL_AFTER= 6 | SIMSIMI_LANG= 7 | REPOST_LAST_CHAT=100 -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "discord-selfbot", 3 | "version": "1.0.0", 4 | "description": "Simple Discord SelfBot", 5 | "main": "index.js", 6 | "scripts": { 7 | "start": "node index.js", 8 | "test": "echo \"Error: no test specified\" && exit 1" 9 | }, 10 | "repository": { 11 | "type": "git", 12 | "url": "git+https://github.com/vsec7/Discord-SelfBot.git" 13 | }, 14 | "keywords": [ 15 | "Discord", 16 | "SelfBot", 17 | "Bot" 18 | ], 19 | "author": "Verry Darmawan", 20 | "license": "MIT", 21 | "bugs": { 22 | "url": "https://github.com/vsec7/Discord-SelfBot/issues" 23 | }, 24 | "homepage": "https://github.com/vsec7/Discord-SelfBot#readme", 25 | "dependencies": { 26 | "axios": "^0.26.1", 27 | "dc-api": "^1.0.1", 28 | "dotenv": "^16.0.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Discord SelfBot 2 | 3 | Simple Discord Self Bot 4 | 5 | Created By viloid (github.com/vsec7) 6 | 7 | *** NOTE : USE AT YOUR OWN RISK! *** 8 | 9 | ## • Installation 10 | 11 | ```bash 12 | git clone https://github.com/vsec7/Discord-SelfBot.git 13 | cd Discord-SelfBot 14 | npm install 15 | cp .env.example .env 16 | ``` 17 | 18 | ## • Edit Configurations *.env* file 19 | 20 | ```env 21 | BOT_TOKEN= # Discord SelfBot Token *Required 22 | CHANNEL_ID= # channel id *Required 23 | MODE= # mode: quote, simsimi, repost *Leave blank Default: quote 24 | DELAY=10000 # Delay per send massage *millisecond 25 | DEL_AFTER= # Delete after send *Leave blank if you dont use it *millisecond 26 | SIMSIMI_LANG= # SimSimi Language : id, en *Leave blank Default: id 27 | REPOST_LAST_CHAT=50 # Repost from last ?n chat in channel 28 | ``` 29 | ## • How to get Discord SelfBot Token? 30 | 31 | ``` 32 | javascript:var i = document.createElement('iframe');i.onload = function(){var localStorage = i.contentWindow.localStorage;prompt('DC Token By @github.com/vsec7', localStorage.getItem('token').replace(/["]+/g, ''));};document.body.appendChild(i); 33 | ``` 34 | 35 | Paste in your url bar when open discord web 36 | 37 | word **javascript** may removed by browser , you can type it manual. 38 | 39 | or you can create bookmark and paste this js inject to url bookmark, and click when open discord web 40 | 41 | ## • How to Run? 42 | ```bash 43 | npm start 44 | or 45 | node index.js 46 | ``` 47 | ## • Features 48 | - Send Quote message 49 | - Send Response simsimi 50 | - Send Repost message from history 51 | - Auto Delete message 52 | 53 | ## • Donation 54 | 55 | SOL Address : viloid.sol 56 | 57 | BSC Address : 0xd3de361b186cc2Fc0C77764E30103F104a6d6D07 58 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | require('dotenv').config(); 2 | const axios = require('axios'); 3 | const Discord = require('dc-api') 4 | 5 | /* 6 | Simple Discord Self Bot 7 | Created by viloid ( github.com/vsec7 ) 8 | Date : 13/03/2022 9 | NOTE : USE AT YOUR OWN RISK! 10 | */ 11 | 12 | if (!process.env.BOT_TOKEN) { 13 | throw new Error('Token is Required!'); 14 | } 15 | 16 | if (!process.env.CHANNEL_ID) { 17 | throw new Error('Channel ID is Required!'); 18 | } 19 | 20 | const bot = new Discord(process.env.BOT_TOKEN) 21 | const c = process.env.CHANNEL_ID; 22 | 23 | async function simsimi(input, lc) { 24 | // Simsimi 25 | const url = 'https://api.simsimi.net/v2/?lc='+ lc +'&text='+ input; 26 | let res = await axios.get(url); 27 | return res.data['success']; 28 | } 29 | 30 | async function Quote() { 31 | // Quote 32 | const url = 'https://raw.githubusercontent.com/lakuapik/quotes-indonesia/master/raw/quotes.min.json'; 33 | let res = await axios.get(url); 34 | return res.data[Math.floor((Math.random()*res.data.length))].quote; 35 | } 36 | 37 | bot.GetMe().then(r => { 38 | const me = r.username + '#' + r.discriminator 39 | console.log("Logged in as %s", me) 40 | }); 41 | 42 | const mode = process.env.MODE || 'quote'; 43 | 44 | console.log("MODE : %s", mode) 45 | 46 | switch(mode) { 47 | case "quote": 48 | setInterval (function () { 49 | bot.GetMessage(c, 1).then(m => { 50 | Quote().then(r => { 51 | bot.SendMessage(c, r).then(m => { 52 | console.log("[SEND][%s] %s", m.id, m.content) 53 | if(process.env.DEL_AFTER){ 54 | setTimeout(() => 55 | bot.DeleteMessage(c, m.id).then(d => { 56 | console.log("[DELETE][%s] %s", m.id, m.content) 57 | }), 58 | process.env.DEL_AFTER) 59 | } 60 | }) 61 | }) 62 | }) 63 | }, process.env.DELAY); 64 | break; 65 | case "simsimi": 66 | setInterval (function () { 67 | bot.GetMessage(c, 1).then(m => { 68 | const lc = process.env.SIMSIMI_LANG || 'id' 69 | simsimi(m.reverse()[0].content, lc).then(r => { 70 | bot.SendMessage(c, r).then(m => { 71 | console.log("[SEND][%s] %s", m.id, m.content) 72 | if(process.env.DEL_AFTER){ 73 | setTimeout(() => 74 | bot.DeleteMessage(c, m.id).then(d => { 75 | console.log("[DELETE][%s] %s", m.id, m.content) 76 | }), 77 | process.env.DEL_AFTER) 78 | } 79 | }) 80 | }) 81 | }) 82 | }, process.env.DELAY); 83 | break; 84 | case "repost": 85 | setInterval (function () { 86 | const last_chat = process.env.REPOST_LAST_CHAT || 100 87 | bot.GetMessage(c, last_chat).then(m => { 88 | bot.SendMessage(c, m.reverse()[0].content).then(m => { 89 | console.log("[SEND][%s] %s", m.id, m.content) 90 | if(process.env.DEL_AFTER){ 91 | setTimeout(() => 92 | bot.DeleteMessage(c, m.id).then(d => { 93 | console.log("[DELETE][%s] %s", m.id, m.content) 94 | }), 95 | process.env.DEL_AFTER) 96 | } 97 | }) 98 | }) 99 | }, process.env.DELAY); 100 | break; 101 | default: 102 | console.log("[!] Available mode: quote, simsimi, repost") 103 | } 104 | --------------------------------------------------------------------------------