-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.py
62 lines (57 loc) · 1.98 KB
/
bot.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
import os
from commands import arguments
commandList = []
prefix = "-"
class command():
global commandList
listenerc = ""
namec = ""
fileoutputc = ""
def __init__(self, listener, fileoutput, name):
self.listenerc = listener
self.namec = name
self.fileoutputc = fileoutput
commandList.append(self)
def runCommand(program, fullmessage, message):
arguments.messageReturn = "No Message"
if os.path.exists("commands/" + program.fileoutputc):
for word in fullmessage:
if fullmessage.index(word) != 0:
arguments.args.append(word)
arguments.currentmessage = message
exec(open("commands/" + program.fileoutputc).read())
arguments.args = []
arguments.currentmessage = ""
return arguments.messageReturn
else:
print("No File Stupid Head")
def check_commands(message, fullmessage):
for item in commandList:
if item.listenerc == fullmessage[0]:
return runCommand(item, fullmessage, message)
def check_first(fullmessage):
for item in commandList:
if item.listenerc == fullmessage[0]:
return True
return False
def load_commands(): #commands
command('weather', "weather.py", "WeatherShow")
command('gamer', 'gamer.py', 'Gamer')
command('trump', "donaldtrump.py", "Trump")
command('help', 'help.py', "Help")
command('roulette', 'roulette.py', "RouletteStart")
command('players', 'players.py', "PlayerSelect")
command('next', 'nextround.py', "NextRound")
command('prefix', 'prefix.py', "ChangePrefix")
command('annoy', 'annoy.py', "yay")
command('fib', 'fibstart.py', "FibStart")
command('join', 'join.py', "JoinGame")
command('start', 'start.py', "GameStart")
command('ping', 'ping.py', "ping")
command('flip', 'coinflip.py', "CoinFlip")
command('suggest', 'suggest.py', 'issue')
command('end', 'endgame.py', "EndGame")
command('bal', 'currencyget.py', "Currency")
command('daily', 'dailyget.py', "DailyReward")
command('sadness', 'sadness.py', "FreeStuff")
command('invite','invite.py',"Invite")