forked from torrrrrac/spamcord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
85 lines (65 loc) · 3.15 KB
/
main.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
import discord
from decouple import config
client = discord.Client()
bot_token = config('TOKEN')
prefix = ';'
cap = 250
check = False
def __init__(self):
self.prefix = ';'
self.cap = 250
self.check = False
@client.event
async def on_ready():
print('We have logged in arse {0.user}'.format(client))
await client.change_presence(status=discord.Status.idle, activity=discord.Activity(
type=discord.ActivityType.playing, name=prefix + "spam across all servers"
))
@client.event
async def on_message(message):
if message.context.startswith(prefix + 'stop'):
global check
check = True
try:
@client.event
async def on_message(message):
send = ""
global prefix
global cap
todo = message.content.split(prefix, 1)[1].split(' ' + prefix)
if message.author == client.user:
return
if message.content.startswith(prefix + 'help'):
await message.channel.send(">>> ***Hey! " + message.author.name + ''',*** you can *spam* messages into any text channel just by typing
`''' + prefix + '''spam ''' + prefix + '''[your text] ''' + prefix + '''[number of times to send]`
_Example_ : `''' + prefix + '''spam ''' + prefix + '''I am Spamcord ''' + prefix + '''10` \n \n Wanna change the prefix `''' + prefix + '''`, I got you covered - type `''' + prefix + '''changepf <your prefix here>`
**ENJOY TROLLING YOUR FRIENDS XD** :joy:''')
if message.content.startswith(prefix + 'changepf'):
prefix = message.content.split(' ')[1]
await message.channel.send(
'Yay! I successfully changed the prefix to ' + prefix + ", on the request of " + message.author.name)
if message.content.startswith(prefix + 'hello') or message.content.startswith(prefix + 'hi'):
await message.channel.send('Hello! ' + message.author.name)
if message.content.startswith(prefix + 'spam'):
try:
if int(todo[2]) > cap:
await message.channel.send("Sorry But due to DISCORD Limitations We are not allowed to spam more than " + str(cap) + " messages to this channel. Please enter a number less than that :D")
elif int(todo[2]) < 1:
await message.channel.send("Please enter a valid number ^_^")
else:
for i in range(int(todo[2])):
global check
await message.channel.send(todo[1])
if check:
check = False
break
finally:
print(IndexError)
if message.content.startswith(prefix + 'setcap'):
await message.channel.send("Noice! now the spam cap is set to " + message.content.split(' ')[1] + ", instead of " + str(cap) + ", on the request of " + message.author.name)
cap = int(message.content.split(' ')[1])
if message.content.startswith(prefix + 'cap'):
await message.channel.send("The current spam cap is " + str(cap))
finally:
print(Exception)
client.run(bot_token)