This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMass-Dmer.py
190 lines (163 loc) · 5.63 KB
/
Mass-Dmer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
import discord
import time
import random
import string
from discord.utils import get
from discord.ext import commands
import asyncio
import requests
from requests import post
global autodm
global ftime
global stime
stime = 0
ftime = '0'
autodm = '0'
def SpamSetUp():
global inv
global messagecount
global messagesend
global thedm
inv=input("what is the invite link (just the string of letters or enter nothing if they are already in): ")
link = "https://discord.com/api/v6/invites/" + inv.split("/")[-1]
joined = 0
failed = 0
with open("tokens.txt", "r") as f:
tokens = f.read().splitlines()
for token in tokens:
headers = {"Content-Type": "application/json",
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11",
"Authorization" : token}
response = post(link, headers=headers).status_code
if response > 199 and response < 300:
joined += 1
else:
failed += 1
print("Accounts that joined: "+str(joined))
print("Accounts that could not join: "+str(failed))
print("-----")
messagecount=input("how many messages should each user send (must be integer): ")
messagesend = input("type what you want the bots to spam here: ")
thedm = input('What do you want the dm on message to be? ')
if thedm == '':
thedm = '👋 Why, hello there 👋'
def randomletters(length):
letters = string.ascii_letters
return ''.join(random.choice(letters) for i in range(length))
time.sleep(2)
with open("tokens.txt", "r") as f:
tokens = f.read().splitlines()
class multibot(commands.Cog):
global client
def __init__(self, client):
self.client=client
@commands.Cog.listener()
async def on_message(self,message):
global autodm
global thedm
global ftime
await client.process_commands(message)
print(f'In {message.guild}, {message.author.name} sent: {message.content}')
if autodm == '1':
#triggerwords = ['hi', 'this', 'is', 'cool']
#for x in triggerwords:
#if x in message.content:
try:
print(f'Sending the dm: {thedm}')
await message.author.send(thedm)
time.sleep(1)
print('Done')
except:
pass
# else:
# pass
else:
return
@commands.command()
async def spam(self,ctx,args1,args2):
x=0
for x in range(0,int(args2)):
asyncio.sleep(0.7)
print("sending message "+random.choice(string.ascii_letters))
try:
await ctx.send(args1)
except:
print("message error")
pass
x=x+1
# @commands.command()
# async def dall(self,ctx, *, message):
# for member in get_all_members():
# #await member.send(message)
# print(member)
@commands.command()
async def spamuser(self,ctx,args1,args2,args3): #formate -spamuser {message} {ammount of times} {userid}
x=0
try:
intargs2 = int(args2)
intargs3 = int(args3)
except:
ctx.send('The formate is: -spamuser {message} {ammount of times} {userid}')
return
for x in range(0,intargs2):
asyncio.sleep(0.7)
print("sending message "+random.choice(string.ascii_letters))
try:
user = client.get_user(intargs3)
await user.send(args1)#('👀')
except:
print("message error")
pass
x=x+1
@commands.command()
async def spamstart(self,ctx):
global inv
global messagecount
global messagesend
x=0
for x in range(0,int(messagecount)):
asyncio.sleep(0.7)
print("sending message "+random.choice(string.ascii_letters))
try:
await ctx.send(messagesend)
except:
print("message error")
pass
x=x+1
@commands.command()
async def massroleping(self,ctx):
guild = ctx.guild
print(f'pinging {len(guild.roles)} roles...')
for role in guild.roles:
if str(role) == '@everyone':
print(f'bybassing {role}')
pass
print(f'role: {role} ping: {role.mention}')
await ctx.send(role.mention)
@commands.command()
async def massuserping(self,ctx):
guild = ctx.guild
print(f'pinging {len(guild.members)} users...')
for member in guild.members:
print(f'user: {member} ping: {member.mention}')
await ctx.send(member.mention)
@commands.command()
async def stop(self,ctx):
exit(0)
async def timer():
global stime
print('This is a one sec delay')
if stime == 0:
return
else:
stime = stime - 1
await asyncio.sleep(1.5)
await timer()
loop = asyncio.get_event_loop()
for i in range(len(tokens)):
global client
client = commands.Bot(command_prefix="-",fetch_offline_members=False,self_bot=False)
client.add_cog(multibot(client))
loop.create_task(client.start(tokens[i], bot=False))
SpamSetUp()
loop.run_forever()