-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.py
78 lines (63 loc) · 2.47 KB
/
init.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
import asyncio
import random
from colorama import Back, Fore, Style
import sys
import os
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import help_info
import auth
#Auth is set up like so:
#auth_token = 'DISCORD TOKEN'
#conn = "mongodb+srv://MONGODBUSER:[email protected]"
client = discord.Client()
bot = commands.Bot(command_prefix='>')
extensions = ['encoding_decoding', 'cipher', 'ctfs', 'utility']
bot.remove_command('help')
blacklisted = []
cool_names = ['_Wh1t3r0se_#7515', 'BlackCoffe#2718', 'a.lil.sus#7939']
# This is intended to be able to be circumvented.
# If you do something like report a bug on GITHUB.
@bot.event
async def on_ready():
print(('<' + bot.user.name) + ' Online>')
print(f"discord.py {discord.__version__}\n")
await bot.change_presence(activity=discord.Game(name='>help'))
@bot.event
async def on_command_error(ctx, error):
if isinstance(error, commands.CommandNotFound):
await ctx.send("Invalid command passed. Use >help")
else:
await ctx.send(f"There was an error, sorry!\nIf you think this should be fixed, report it with >report \"what happened\"")
print(Style.BRIGHT + Fore.RED + f"Error occured with: {ctx.command}\n{error}\n")
print(Style.RESET_ALL)
# Sends the github link.
@bot.command()
async def source(ctx):
await ctx.send(help_info.src)
@bot.command()
async def help(ctx, page=None):
if page == 'ctftime':
emb = discord.Embed(description=help_info.ctftime_help, colour=4387968)
emb.set_author(name='CTFTime Help')
elif page == 'utility':
emb = discord.Embed(description=help_info.utility_help, colour=4387968)
emb.set_author(name='Utilities Help')
else:
emb = discord.Embed(description=help_info.help_page, colour=4387968)
emb.set_author(name='Werewolf.exe')
await ctx.channel.send(embed=emb)
@bot.command()
async def amicool(ctx):
authors_name = str(ctx.author)
if any((name in authors_name for name in cool_names)):
await ctx.send('You are very cool')
else:
await ctx.send('lolno')
await ctx.send('Psst, kid. Want to be cool? Find an issue and report it or request a feature you think would be cool.')
if __name__ == '__main__':
sys.path.insert(1, os.getcwd() + '/cogs/')
for extension in extensions:
bot.load_extension(extension)
bot.run(auth.auth_token)