Closed Chiharuuu closed 8 years ago
Yup, it is possible and should not be difficult to achieve, I will look into it. :)
Check out the latest commit. Please dont forget to update to the current discord.py library:
python3.5 -m pip install --upgrade discord.py
Is it possible to make this bot run as a proper account with bot token? I've tried converting it with what limited knowledge of python that I have, and it's just not working for whatever reason.
configReader.py Edits
``` import re p = re.compile(r"DiscordName=(.*)\nDiscordPW=(.*)\nDiscordToken=(.*)\n.*\n.*\nOwnerID=(.*)") q = re.compile(r"ADDON=(.*)\n") configPath = 'cfg/botConfig.cfg' class ConfigReader: username = '' password = '' token = '' ownerID = '' addonList = [] def readConfig(self): cfgFile = open(configPath, 'r') cfgContent = cfgFile.read() result = re.search(p, cfgContent) self.username = result.groups()[0] self.password = result.groups()[1] self.token = result.groups()[2] self.ownerID = result.groups()[3] addonResults = re.findall(q, cfgContent) for addon in addonResults: print('cfgAddonFound: '+addon) self.addonList.append(addon) def getUsername(self): return self.username def getPW(self): return self.password def getToken(self): return self.token def getOwnerID(self): return self.ownerID def getAddonList(self): return self.addonList ```runBot.py Edits
``` def runBot(self): #super().run(self.cfg.getUsername(), self.cfg.getPW()) super().run(self.cfg.getToken()) ```botConfig.cfg Edits
``` ## DiscordCredentials DiscordName=email (redacted) DiscordPW=password (redacted) DiscordToken=token (redacted) #Owner Settings OwnerID=id (redacted) DefaultVoiceChannel=channel (redacted) #Addon list goes here ADDON=onlineRadio ```I've tried everything that I can think of, and every time I run the bot it throws back this:
Maybe I'm just stupid and know nothing about Python/discord.py, but I'd appreciate any help on this... been trying for a while now and just can't get it to work properly.