-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun.py
51 lines (37 loc) · 1.22 KB
/
run.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
import configparser
import discord
from discord.utils import get
from command import Command
# from CroBot import requests
# Create a client and command object
client = discord.Client()
command = Command()
# Register commands from features
from CroBot.features.cro.commands import cro_command
from CroBot.features.sdvxin.commands import sdvx_command
from CroBot.features.eamuse.commands import eamuse_command
command.register_all(cro_command)
command.register_all(sdvx_command)
command.register_all(eamuse_command)
@client.event
async def on_ready():
print('Logged in as')
print(client.user.name)
print(client.user.id)
print('------')
@client.event
async def on_message(message):
await command.do(client, message)
# Hacked in for personal server role permissions
GVM_SERVER_ID = 393603672778604544
@client.event
async def on_member_join(member):
if member.guild.id == GVM_SERVER_ID:
await member.add_roles(get(member.guild.roles, name='Players'))
if __name__ == '__main__':
# Read in the settings file and retrieves the token
config = configparser.ConfigParser()
config.read('settings.ini')
token = config['discord']['token']
# Passes the token to the client
client.run(token)