Python and Twitch Commands

I am working on porting a mIRC/mSL bot into Python.
So far things have been going good except for I am stuck on my commands portion.
In mIRC used ini files, and $readini to read a file for commands and retrieved their output.
However, I am not sure if/how I could do the same thing for Python. I like the ability to be able to use !addcommand and similar things to add commands without having to put them in the bots code explicitly.
Any/all help is appreciated :slight_smile:

I’m not that familiar with python, but configparser looks like the thing you’re looking for. Here’s an example from StackOverflow.

I took a look at that. I’m still not quite sure how I would set up the command.

Still looking for help

For awhile I used json files, now I store commands in a database, but you could do any sort of data persistence that your heart desires.

I’m sure there are tons of examples out there, and my bot definitely isn’t the best, but if you’d like to see it’s source code let me know.

@GaryTheCoolGuyIII, you might have more luck with a place like reddit or StackOverflow for general questions about Python and IRC development. The link @3ventic posted shows how to read and write an INI file. Not sure what else you’re looking for with regards to Twitch development.

I was also looking on how other people handled putting commands into their bot. If they used similar methods, if they use different methods, etc. I’m not set in stone about carrying over the INI file, it was just a method I was familiar, but I want to know what other people are using too and seeing if there’s a new method I’d prefer.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.