forked from johnsunxu/prinz-eugen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rushBot.py
81 lines (66 loc) · 3.13 KB
/
rushBot.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
# This file is part of Prinz Eugen.
# Prinz Eugen is free software: you can redistribute it and/or modify it under the terms
# of the GNU Affero General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
# Prinz Eugen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU Affero General Public License for more details.
# You should have received a copy of the GNU Affero General Public License along with Prinz
# Eugen. If not, see <https://www.gnu.org/licenses/>.
import random
import discord
import os
from discord.ext import commands
client = commands.Bot(command_prefix = ";")
client.remove_command("help")
@client.event
async def on_message(message):
# do some extra stuff here
if message.author.bot == False and message != None and message.content.startswith(';') and message.guild:
await client.process_commands(message)
print(message.guild)
#yell at people in #meta-help
# channel = 643697081210503168 #769323138009661484;
# if message.channel.id == channel and message.author.bot == True and message.content != 'Please avoid using bots unless part of a discussion!':
# #get person who typed command
# lastMessages = await message.channel.history(limit=5).flatten();
#
# #user
# for i in lastMessages:
# print(i.content)
#
# user = lastMessages[1].author;
# member = discord.utils.get(client.guild.members, id=user.id)
#
# print(member.roles);
# #FCLC, Drakomire Solle Tipin Smugg TheStrictNein Fire AwkwardNinja Endiku Tsubonk
# whitelist = [517171091060293633, 318076068290494466,256098495667240961, 820729385983410256, 181096628394917889, 324219750790201345, 820729887659917332, 170431340448186370, 199713237636349952, 184925630998118400,
# #Loxi #Mirrage Rebellion #Fal #Captain Mika dontcallmeFFC
# 299903786422632448, 158331365757157376, 218864290646458368, 799884633042845716, 494130472859729922];
#
# if not in whitelist:
# await message.channel.send("Please avoid using bots unless part of a discussion!");
#Load cogs
@client.command()
async def load(ctx, extension):
client.load_extension(f"cogs.{extension}")
await ctx.send("Load successful!")
#Unload cogs
@client.command()
async def unload(ctx, extension):
client.unload_extension(f"cogs.{extension}")
await ctx.send("Unload successful!")
@client.command()
async def reload(ctx, extension):
try:
client.unload_extension(f"cogs.{extension}")
except:
pass
client.load_extension(f"cogs.{extension}")
await ctx.send("Reload successful!")
#Scan for cogs
for filename in os.listdir("./cogs"):
print(filename)
if filename.endswith(".py"):
client.load_extension(f"cogs.{filename[:-3]}")
client.run(os.environ.get('token'))