-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcursed.py
41 lines (26 loc) · 969 Bytes
/
cursed.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
from discord.ext import commands
import discord
import traceback
def get_prefix(bot, message):
prefixes = ['<']
if not message.guild:
return ''
return commands.when_mentioned_or(*prefixes)(bot, message)
cogs = ['cogs.owner', 'cogs.cursed']
bot = commands.Bot(command_prefix=get_prefix, case_insensitive=True, description='I AM cursedbot. FEAR ME!')
if __name__ == '__main__':
for cog in cogs:
bot.load_extension(cog)
@bot.event
async def on_ready():
print(f'Logged in as: {bot.user.name} - {bot.user.id}\nVersion: {discord.__version__}\n')
await bot.change_presence(activity=discord.Streaming(name="cursed images", url="https://www.twitch.tv/c"))
# @bot.event
# async def on_command_error(ctx, error):
# if isinstance(error, commands.CommandNotFound):
# print('no found')
# else:
# print(error)
with open('token.txt') as f:
token = f.readline()
bot.run(token, bot=True, reconnect=True)