-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkrbot.py
32 lines (23 loc) · 952 Bytes
/
krbot.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
import discord
from discord.ext import commands
import logging
import os
import sys
def get_prefix(bot_, message):
prefixes = ['??']
return commands.when_mentioned_or(*prefixes)(bot_, message)
initial_extensions = ['cogs.announce']
bot = commands.Bot(command_prefix=get_prefix, description='A Discord Bot for King\'s Raid')
@bot.event
async def on_ready():
logging.basicConfig(level=logging.INFO)
print(f'\n\nLogged in as: {bot.user.name} - {bot.user.id}\nVersion: {discord.__version__}\n')
await bot.change_presence(activity=discord.Game(name='King\'s Raid'))
if __name__ == '__main__':
for extension in initial_extensions:
try:
bot.load_extension(extension)
except Exception as e:
print(f'Failed to load extension {extension}.', file=sys.stderr)
print(f'Successfully logged in and booted...!')
bot.run(os.environ['TOKEN'], bot=True, reconnect=True)