def __init__(self, bot):
self.bot = bot
self.waifu1votes = 0
self.waifu2votes = 0
self.startTime = 0
self.duration = 120
#Initialize empty set for users that have already voted
self.alreadyVoted = set({})
#Initialize empty list for channels to announce winners to
self.channels = set({})
#Login stuff from Safebooru
parser = configparser.ConfigParser()
parser.read('data/auth/auth.ini')
self.has_login = False
if not parser.has_section("Safebooru Login"):
self.session = aiohttp.ClientSession()
print("No Safebooru credentials provided; api calls will be anonymous")
else:
self.loginName = parser['Safebooru Login']['Username']
self.loginToken = parser['Safebooru Login']['Token']
if self.loginName != "" and self.loginToken != "":
self.session = aiohttp.ClientSession(auth=aiohttp.BasicAuth(self.loginName, self.loginToken))
self.has_login = True
else:
self.session = aiohttp.ClientSession()
atexit.register(self.closeConnection)
#Starts the waifu war
评论列表
文章目录