├── requirements.txt ├── custom.txt ├── config.yaml ├── README.md └── bot.py /requirements.txt: -------------------------------------------------------------------------------- 1 | requests>=2.25.0 2 | PyYAML>=5.3 -------------------------------------------------------------------------------- /custom.txt: -------------------------------------------------------------------------------- 1 | gm 2 | gn 3 | wah 4 | met pagi 5 | selamat kak 6 | iyaa bg 7 | iyaa 8 | kenapa? 9 | baik 10 | keren kak -------------------------------------------------------------------------------- /config.yaml: -------------------------------------------------------------------------------- 1 | BOT_TOKEN: 2 | - ODE3MzkzOTQ4xxxxxxxxxxxxxxxxxxxx 3 | - ODk1NTEyMDExxxxxxxxxxxxxxxxxxxxx 4 | CHANNEL_ID: 5 | - 10300xxxxxxxxxxxxxx 6 | - 87751xxxxxxxxxxxxxx 7 | MODE: custom 8 | REPLY: 9 | SIMSIMI_LANG: en 10 | DELAY: 10 11 | DEL_AFTER: 12 | REPOST_LAST_CHAT: 100 -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Discord SelfBot 2 | 3 | Simple Discord Self Bot Python version 4 | 5 | Created By viloid (github.com/vsec7) 6 | 7 | *** NOTE : USE AT YOUR OWN RISK! *** 8 | 9 | ## • Features 10 | - Send Quote message 11 | - Send Response Simsimi message 12 | - Send Repost message from channel chat history 13 | - Send select random line from custom.txt 14 | - Auto Delete message 15 | 16 | ## • Requirements 17 | - Python3 18 | 19 | ## • Installation 20 | 21 | ```bash 22 | git clone https://github.com/vsec7/DiscordSelfbot.git 23 | ``` 24 | 25 | ## • Edit Configurations *config.yaml* file 26 | 27 | ```env 28 | BOT_TOKEN: # Discord SelfBot Token *Required 29 | - Discord Token 1 # You can add multiple discord token 30 | - Discord Token 2 31 | CHANNEL_ID: # channel id *Required 32 | - Channel Id 1 33 | - Channel Id 2 # You can add multiple channel id 34 | MODE: # mode: (quote, repost, simsim, custom) *Leave blank Default: quote 35 | REPLY: Y # For simsimi mode only *Leave blank if you dont use it 36 | SIMSIMI_LANG: # Simsimi Language (id/en) *Leave blank Default: id 37 | DELAY: 60 # Delay per send massage *second 38 | DEL_AFTER: Y # Delete after send *Leave blank if you dont use it 39 | REPOST_LAST_CHAT: 100 # Repost from last ?n chat in channel 40 | ``` 41 | ## • How to get Discord SelfBot Token? 42 | 43 | ``` 44 | javascript:(()=>{var t=document.body.appendChild(document.createElement`iframe`).contentWindow.localStorage.token.replace(/["]+/g, '');prompt('Get Selfbot Discord Token by github.com/vsec7', t)})(); 45 | ``` 46 | 47 | [DETAILS CLICK HERE](https://gist.github.com/vsec7/12066af3f704bd337c52c30f4c492ba2) 48 | 49 | Paste in your url bar when open discord desktop browser 50 | 51 | word **javascript** may removed by browser , you can type it manual. 52 | 53 | or you can create bookmark and paste this js inject to url bookmark, and click when open discord web 54 | 55 | ## • How to Run? 56 | ```bash 57 | cd DiscordSelfbot 58 | pip install -r requirements.txt 59 | python bot.py 60 | ``` 61 | 62 | ## • Donate 63 | 64 | SOL Address : viloid.sol 65 | 66 | BSC Address : 0xd3de361b186cc2Fc0C77764E30103F104a6d6D07 67 | -------------------------------------------------------------------------------- /bot.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # Simple Discord SelfBot 3 | # Created By Viloid ( github.com/vsec7 ) 4 | # Use At Your Own Risk 5 | 6 | import requests, random, sys, yaml, time 7 | 8 | class Discord: 9 | 10 | def __init__(self, t): 11 | self.base = "https://discord.com/api/v9" 12 | self.auth = { 'authorization': t } 13 | 14 | def getMe(self): 15 | u = requests.get(self.base + "/users/@me", headers=self.auth).json() 16 | return u 17 | 18 | def getMessage(self, cid, l): 19 | u = requests.get(self.base + "/channels/" + str(cid) + "/messages?limit=" + str(l), headers=self.auth).json() 20 | return u 21 | 22 | def sendMessage(self, cid, txt): 23 | u = requests.post(self.base + "/channels/" + str(cid) + "/messages", headers=self.auth, json={ 'content': txt }).json() 24 | return u 25 | 26 | def replyMessage(self, cid, mid, txt): 27 | u = requests.post(self.base + "/channels/" + str(cid) + "/messages", headers=self.auth, json={ 'content': txt, 'message_reference': { 'message_id': str(mid) } }).json() 28 | return u 29 | 30 | def deleteMessage(self, cid, mid): 31 | u = requests.delete(self.base + "/channels/" + str(cid) + "/messages/" + str(mid), headers=self.auth) 32 | return u 33 | 34 | def quote(): 35 | u = requests.get("https://raw.githubusercontent.com/lakuapik/quotes-indonesia/master/raw/quotes.min.json").json() 36 | return random.choice(list(u))['quote'] 37 | 38 | def simsimi(lc, txt): 39 | u = requests.post("https://api.simsimi.vn/v1/simtalk", data={ 'lc': lc, 'text': txt}).json() 40 | return u['message'] 41 | 42 | def main(): 43 | with open('config.yaml') as cfg: 44 | conf = yaml.load(cfg, Loader=yaml.FullLoader) 45 | 46 | if not conf['BOT_TOKEN']: 47 | print("[!] Please provide discord token at config.yaml!") 48 | sys.exit() 49 | 50 | if not conf['CHANNEL_ID']: 51 | print("[!] Please provide channel id at config.yaml!") 52 | sys.exit() 53 | 54 | mode = conf['MODE'] 55 | simi_lc = conf['SIMSIMI_LANG'] 56 | delay = conf['DELAY'] 57 | del_after = conf['DEL_AFTER'] 58 | repost_last = conf['REPOST_LAST_CHAT'] 59 | 60 | if not mode: 61 | mode = "quote" 62 | 63 | if not simi_lc: 64 | simi_lc = "id" 65 | 66 | if not repost_last: 67 | repost_last = "100" 68 | 69 | while True: 70 | for token in conf['BOT_TOKEN']: 71 | try: 72 | 73 | for chan in conf['CHANNEL_ID']: 74 | 75 | Bot = Discord(token) 76 | me = Bot.getMe()['username'] + "#" + Bot.getMe()['discriminator'] 77 | 78 | if mode == "quote": 79 | q = quote() 80 | send = Bot.sendMessage(chan, q) 81 | print("[{}][{}][QUOTE] {}".format(me, chan, q)) 82 | if del_after: 83 | Bot.deleteMessage(chan, send['id']) 84 | print("[{}][DELETE] {}".format(me, send['id'])) 85 | 86 | elif mode == "repost": 87 | res = Bot.getMessage(chan, random.randint(1,repost_last)) 88 | getlast = list(reversed(res))[0] 89 | send = Bot.sendMessage(chan, getlast['content']) 90 | print("[{}][{}][REPOST] {}".format(me, chan, getlast['content'])) 91 | if del_after: 92 | Bot.deleteMessage(chan, send['id']) 93 | print("[{}][DELETE] {}".format(me, send['id'])) 94 | 95 | elif mode == "simsimi": 96 | res = Bot.getMessage(chan, "1") 97 | getlast = list(reversed(res))[0] 98 | simi = simsimi(simi_lc, getlast['content']) 99 | 100 | if conf['REPLY']: 101 | send = Bot.replyMessage(chan, getlast['id'], simi) 102 | print("[{}][{}][SIMSIMI] {}".format(me, chan, simi)) 103 | else: 104 | send = Bot.sendMessage(chan, simi) 105 | print("[{}][{}][SIMSIMI] {}".format(me, chan, simi)) 106 | 107 | if del_after: 108 | Bot.deleteMessage(chan, send['id']) 109 | print("[{}][DELETE] {}".format(me, send['id'])) 110 | 111 | elif mode == "custom": 112 | c = random.choice(open("custom.txt").readlines()) 113 | send = Bot.sendMessage(chan, c) 114 | print("[{}][{}][CUSTOM] {}".format(me, chan, c)) 115 | if del_after: 116 | Bot.deleteMessage(chan, send['id']) 117 | print("[{}][DELETE] {}".format(me, send['id'])) 118 | 119 | except: 120 | print(f"[Error] {token} : INVALID TOKEN / KICKED FROM GUILD!") 121 | 122 | print("-------[ Delay for {} seconds ]-------".format(delay)) 123 | time.sleep(delay) 124 | 125 | if __name__ == '__main__': 126 | try: 127 | main() 128 | except Exception as err: 129 | print(f"{type(err).__name__} : {err}") 130 | --------------------------------------------------------------------------------