Skip to content

Newbie here #370

Dec 20, 2022 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

Hi,

Please do not use time.sleep() as this is blocking the event loop. You should be using asyncio.sleep() if you need to pause a coroutine.
Globals are also a bad practice to use, especially in an OOP style framework. Simply create an attribute of the bot subclass.

I'm also not quite sure why you are calling list() on your prefixes when they are already a list tag = ['!', '?']
The same goes for channels.....

  1. This is exactly one of the purposes of routines, as you can see in the examples in the documentation, you can add a time for which you want the routine to routinely run and how many (or infinite) iterations. https://twitchio.dev/en/latest/exts/routines.html
  2. Create self.msg_counter = 0

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@GMPerfectZ
Comment options

@chillymosh
Comment options

Answer selected by chillymosh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants