From yesterday off stream
try:
bot = Bot()
await bot.connect()
await asyncio.wait_for(bot.wait_for_ready(), timeout=10.0)
print(f"connected at {time.strftime('%X')}")
channel = bot.get_channel("bedtimebear_808")
await channel.send("hello world")
print(f"sent a hello world message at {time.strftime('%X')}")
finally:
await channel.send("closed")
print(f"sent a closed message at {time.strftime('%X')}")
await bot.close()
print(f"closed at {time.strftime('%X')}")
console log
➤ python3 main.py
started at 20:05:36
Logged in as | bedtimebear_bot
User id is | 549829723
connected at 20:05:36
sent a hello world message at 20:05:36
sent a closed message at 20:05:36
closed at 20:05:36
output at twitch.tv/bedtimebear_808
bedtimebear_bot: hello world
bedtimebear_bot: closed
Things we learned
If we hit ‘.’ on github it takes us to visual studio code view of the repo. Thank you to keraion for the suggestion. My mind is blown!
Task Completed
- Rewrote the git history
- Fix words pair to tracked words.
WordPair
is not right.
Future prework
- Fire and forgetting. Especially
wt.recordWordsFromMicrophone(record_duration_sec=5.0)
- We could use the twichio.ext.routines to schedule sending chat the top
words said during stream in an interval. velusip mentioned that the order of
defining the routine might have to occur after the
bot.start()
function.
Future work
- Call the chat bot and word tracker separately without blocking each other.
- Use GitHub integrations to run Python test with Poetry.
- Create blog post of cloud storage and load balancer experience for a static website (hugo). Also, use Colemak…
Useful links
- commit message format: https://github.com/commitizen/cz-cli
- rewrite from root commit https://stackoverflow.com/a/21048552
- https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History
- https://git-scm.com/docs/git-cherry-pick
- Routines is a twitchio way to schedule tasks https://twitchio.dev/en/latest/exts/routines.html#recipes
- A way to fire and forget tasks https://docs.python.org/3/library/asyncio-task.html#creating-tasks