Help Needed With A While Loop Messenger (Python) For Twitch

Hello all!

I’ve been experimenting for, if I’m honest, a considerable amount of time attempting to make a function that posts social / sponsored links to a Twitch channel via a Python bot on a timer in a sequenced fashion (Night Bot has a similar behaviour). I’ve already figured out the sequencing; that was accomplished by using the “index” method with a tuple of links, while the time.sleep() function handles the posting at varying intervals depending on the variable value. And “continue” allows the sequence to repeat itself indefinitely. But unfortunately, I cannot seem to get it to actually post to Twitch! I’ve also looked into various solutions for this, but internet searches are usually inappropriate. For example, they’re often based on callbacks e.g. a defined function requiring something to happen to post a message. Also, I’ve experimented with attempting to use the channel name in the code, assuming that was the “missing ingredient” sorta speak, but haven’t been able to get it right seemingly.

Just mentioning, I’m quite new to Python and not the most experienced with conventional programming outside UE3 and UE4’s scripting languages and a bit of VBA and Actionscript 3, so go easy on me! Haha. Also, the program I’m using was originally a tutorial I followed. Finally, most of the networking stuff is in another module, yet it doesn’t work when posted in the same one.

Code thus far:

def SequencedLink(self, bot):
    while True:
        links = ["", "", "", ""]
    for i in range(len(links)):
        bot.send_message (f"A sequenced link: {(links[i])}")
        print(f"A sequenced link: {(links[i])}")


I’m assuming I’m probably missing something obvious, but If you need any more information, let me know.

Thanks, people!