Skip to content
Snippets Groups Projects
Commit 56f4d021 authored by dnns01's avatar dnns01
Browse files

Use event_loop for info loop

parent a63b3bac
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.9 (haugebot) (2)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TemplatesService">
......
......@@ -3,5 +3,5 @@
<component name="JavaScriptSettings">
<option name="languageLevel" value="ES6" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.8 (haugebot)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (haugebot) (2)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
......@@ -34,11 +34,11 @@ class HaugeBot(commands.Bot, ABC):
super().__init__(irc_token=IRC_TOKEN, prefix=PREFIX, nick=NICK, initial_channels=[CHANNEL], client_id=CLIENT_ID,
client_secret=CLIENT_SECRET)
self.info_cog = InfoCog(self)
self.pipi_cog = PipiCog(self)
# self.pipi_cog = PipiCog(self)
self.add_cog(GiveawayCog(self))
self.add_cog(VoteCog(self))
self.add_cog(self.info_cog)
self.add_cog(self.pipi_cog)
# self.add_cog(self.pipi_cog)
@staticmethod
async def send_me(ctx, content, color):
......@@ -54,8 +54,9 @@ class HaugeBot(commands.Bot, ABC):
async def event_ready(self):
print('Logged in')
self.info_cog.start_info_loop()
asyncio.create_task(self.info_cog.info_loop())
asyncio.create_task(self.pipi_cog.pipimeter_loop())
# asyncio.create_task(self.pipi_cog.pipimeter_loop())
@staticmethod
def get_percentage(part, total):
......
......@@ -11,6 +11,10 @@ class InfoCog:
def __init__(self, bot):
self.bot = bot
def start_info_loop(self):
loop = asyncio.get_event_loop()
loop.create_task(self.info_loop())
async def info_loop(self):
while True:
sleep_duration = config.get_int("WusstestDuSchonLoop")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment