<p>this was relatively easy to build initially (straight from a template), but building any functionality that I wanted into was, as expected, hard. because i am garbage at python.</p>
SETS A BREAK POINT IN CODE AND I CAN WRITE CODE THERE AND INTERACT WITH IT HOOOO MY GOD
</code></pre></div></div>
<p>this is probably the biggest thing i learned; para exemplar say you have a bit of code that defines a variable eq to individual objects you iterate through one at a time:</p>
<p>sometimes (all the time) you run into problems where maybe one of the variables you defined doesn’t have the data you expect. so in order to troubleshoot you open you repl and try and do some adhoc definitions of variables and tokens so you can see what the deal is. as you might expect, that’s bad and doesn’t work very well. but with pdb.set_trace you can define a break point in your code that will give you a prompt, and then you can type “interact” into the prompt and it will let you type python into a repl provided with the state inherent in that point in your code! how fucking cool is that??</p>
AttributeError: 'dict' object has no attribute 'firstname'
>>> dict[0]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 0
>>> dict["firstname"]
'jowj'
>>>
</code></pre></div></div>
<p>it took me. so. so. so. long.</p>
<h2id="whats-next">what’s next:</h2>
<p>i gotta finish fixing this bot to get everything i want into 1 file (right now i have some of the functionality i want in two different scripts). then maybe add some extra functionality like:</p>
<ul>
<li>commanding to my twitter bot</li>
<li>…other stuff.</li>
</ul>
<h2id="resources">resources:</h2>
<ul>
<li>basic tutorial / code i stole - https://www.fullstackpython.com/blog/build-first-slack-bot-python.html</li>
<li>to set an environment variable in powershell in userscope, you gotta go out to .net - [Environment]::SetEnvironmentVariable(“SLACK_BOT_TOKEN”, “Test value.”, “User”)</li>
<li>responding to messages with specific text - http://pfertyk.me/2016/11/automatically-respond-to-slack-messages-containing-specific-text/</li>