(NSFW) — How I immortalized my friend, which backfired and then moved onto becoming a super annoying chat bot inspired by a YouTube livestream joke

Discord & Python 3.x programming

Photo by Michael Dziedzic on Unsplash

Backstory

At the time of this writing, it has been 7 months since the COVID19 pandemic had taken over the world. Making it harder for me & my group of friends to meet with each other. And then one day, one of us decided to put us all together in a Discord channel so we can still hang out virtually.

Discord lets you install bots like Pancake to do other stuff like loading songs from YouTube & playing it on voice channel everyone listening.

And then one day I thought “why waste such an opportunity?” I immediately got to work. At first I came up with a concept of immortalizing one of our close friends, who we will call “Aki san”.

Our group of friends. Aki-san is the lady on the right.

Aki san is like the older sister of the group. And she is lovable by all, so using her image was perfect! (not that she agreed to it but i’m sure she didn’t mind)

Initial ideas

I took some time to figure out what I could use my expensive talents on for such an almost useless piece of software. And I came up with these ideas:

  1. Send us the news
  2. Tell us a joke
  3. Send pictures of cats

Building the bot

For the chatbot to work I needed my friends IDs and store them safely by not writing them explictly into the code. I would store them in my local shell and load them into the script.

Making good choices. Never ever hard code access tokens or IDs.

By the way, I used the Discord.py library to do this. Why write code all over from scratch when reusing is the easier (and safer) alternative?

Aki bot v.1.1

And presto! The first working version.

Uses the API from https://newsapi.org/ and collects sources from the BBC

Hmm ok, but it’s kind of boring and missing a bit of je nai sais quoi.

Eventually, with the help of some string concatenation, I came up with this function that randomly generates an extra touch of spice.

The final touch to Aki bot

Aki bot v.1.2 (sort of)

Now I have created Aki bot to be the immortalized version of our friend Aki that spits out random news articles to our Discord channel, which included my personal touch.

I’m actually making a lot of my friends uncomfortable at this point.

But as it turns out, reporting the news is lame and nobody cares about an article they can read from their regular social media. So I decided to re-write Aki-bot to send us random pictures of cats. Because everyone loves cats.

Aki bot v.2.0

Well I mean it’s not bad. But as it turns out, nobody cares about a cat loving chat bot that posts pictures of cats.

Not even my friend Danny appreciated this. He gave me a 👎

To make matters worse, it’s creeping people out more than had realized

I guess my sense of humour is really unique …

Ok fine. I needed a new plan.

Enter J.A.R.V.I.S, if he was into roleplay.

I needed to rebuild the chatbot into something more unique without using Akis image that also creeped a couple people out. I chose Jarvis, but I wanted him to have a Short Circuit 2 feel to it. So I created him to be horny using a YouTube livestream joke (which for the life of me can’t find the link anymore).

In short, it spits out very very very very very very very very very very very very *breathes for a minute* very weird suggestions for roleplaying. Here is an example:

We can roleplay as a 37 year old dentist that likes Baseball and has a raging fetish for Armpit hair but every afternoon she contemplates her not spending more time in nature .

It gets way more vulgar than this. But you get the point.

By the way, how it does this is by loading a series of text files, which are lists of words categorized by their file name. Like below:

-rw-r--r--@  1 benji0110  staff   2.1K  4 29 15:15 fetish_list.txt
-rw-r--r--@ 1 benji0110 staff 5.4K 4 29 15:16 hobbies_list.txt
-rw-r--r--@ 1 benji0110 staff 1.2K 4 29 14:43 life_choices.txt
-rw-r--r--@ 1 benji0110 staff 2.8K 4 29 14:33 professions_list.txt

Which off course, the file paths are exported into my local shell and loaded like this:

Probably could’ve been done better. But I thought this way just looked neater. Change my mind.

And with some more string concatenation the end result is this

Automation

If I have to execute Jarvis by hand i would probably not call myself an engineer because I wanted Jarvis to act like it wants to say something when it feels like it.

So the only way I knew how was using cron. Graciously with the help of cron.guru.

Execute Jarvis every Monday, Wednesday & Saturday at 9:30pm
A bash script to first load my bash profiles then execute the python script for Jarvis to work.

And it worked beautifully.

Until I decided to copy & paste one of it’s comments into another Discord channel, which then got me blacklisted from messaging anyone

That was a bad idea

Source code

https://github.com/benji011/roleplaying-J.A.R.V.I.S

Full-Stack Engineer, at one time also officially labelled “Professional Badass”.