This repository has been archived by the owner on Aug 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
51 lines (45 loc) · 1.63 KB
/
main.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
# Wumpus9K - ROBOT9000 for Discord
# Copyright (C) 2018 Valentijn "Ev1l0rd"
#
# This program 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.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
import yaml
import discord
from discord.ext import commands
config = yaml.safe_load(open('config.yaml'))
bot = commands.Bot(command_prefix=commands.when_mentioned_or(
config['prefix']),
description='ROBOT 9000 for Discord')
def load_cog(cog):
try:
bot.load_extension(cog)
except Exception as e:
print('Could not load cog ' + cog)
print(e)
finally:
print(cog + " succesfully loaded")
@bot.event
async def on_ready():
print('WUMPUS9K Copyright (C) 2018 Valentijn "Ev1l0rd"\n' +
'This program comes with ABSOLUTELY NO WARRANTY;\n' +
'This is free software, and you are welcome to redistribute it\n' +
'under certain conditions;')
print('------------')
print('Logged in as:')
print(bot.user.name)
print(bot.user.id)
print('Using prefix:')
print(config['prefix'])
print('------------')
load_cog('wumpus9k')
bot.run(config['token'])