Adventures in making my first discord bot: Alien Honey

avatar

Screen Shot 20201201 at 3.41.39 PM.png

One of our favourite bots in the PAL discord, Kawaii bot was discontinued a few months ago, it was mostly a silly bot, used for giving hugs, pats, kisses and making memes with avatars.

I had long ago saved a few tutorials for making a discord bot but never really got around to it. Last week youtube recommended me a tutorial with a title like: Make a discord bot in under 15 minutes or something click-baity like that so I started watching it and it did seem pretty quick and easy so I decided I would try to make a simple hug bot just to see if I could.

That tutorial taught me the basics of setting it up through discord dev portal and make a simple command in glitch.com where you would say ping and it would respond pong.

Screen Shot 20201201 at 4.12.52 PM.png

Simple enough and it worked, I have to say as a total noob seeing the bot come online and responding was actually pretty exciting!

Now I needed to make it a bit more functional, give it a prefix and add some different commands so I scoured for some more tutorials. I found one that seemed fairly straight forward and was able to follow along and add some more simple commands with pre-fix.

For this I had to download node and Visual code studio.

I knew I wanted to be able to do the hug and also had an idea that I wanted a fun image search function. Basically all the code is lifted from other people's tutorials and cobbled together for my needs! (*sidenote, lots of these youtubers would add a pastebin in the description so you could copy paste but the pastebin leads to a 404/empty page, WHYYYY lol!)

After adding all my commands and doing some troubleshooting, the moment of truth:

Screen Shot 20201201 at 4.27.34 PM.png

IT CAME ONLINE! Again, this probably doesn't sound exciting for anyone who has done this a million times but I was using new software I had never touched and troubleshooting with google so every little success felt like a big deal :D

The final list of commands:

hug and kiss allow you to tag a user and it delivers a random gif from a selection I added to the code, they only have about 15 each rn, I need to add some more gifs so it doesn't get repetitive! Dance is basically the same.

+pepe uses a search engine called dogpile and returns a random rare pepe

Screen Shot 20201201 at 4.23.49 PM.png

HOSTING

I was taking this one step at a time and knew that once I closed visual code studio the bot would go offline again so it needed to be hosted somewhere. There are a multitude of ways to do this but Heroku seems to be the most recommended as you get quite a lot of free hours.

I found yet another tutorial (I watched and read so many damn tutorials over those few days 0_0) on how to get it hosted.

The tutorial was for a python bot and mine was node so I had to again do some googling while following this tutorial as a few things needed to be done differently but not too bad.

This part is almost entirely done in the terminal so I had to install a bunch of stuff before getting started, heroku CLI, git and homebrew IIRC.

After following all the instructions and deploying the terminal gave me a successful build message and the bot came online! I couldn't beleive my luck that all went well the first time around. But... after a few minuted the bot crashed.

I did the command heroku logs and tried to decipher what the heck was happening.

There was some kind of error about START not being detected. Turns out the package.json didn't have the correct code to instruct the bot how to start, even though it started? I don't really get it but googling told me I had to add a bit of code.

I pushed the updated code and the same thing happened, ran for a minute then crashed. Now I was getting more errors in the logs, I can't remember what they all were but I was basically reading stack overflow for a long time. After trying lots of different suggestions and deploying many times I never succeeded in getting it going for longer than a few minutes and after doing a bunch of suggested things including DELETING SOME FILES it wouldn't even come online and respond and was giving some MISSING MODULE errors.

I left it for the night and had time to come back to it a few days later. I started from scratch and made a new folder and did all the steps again! I got the start error again and tried a different bit of code suggested by someone else and on the second deploy IT WAS FINALLY WORKING!

So now it's online and running and has been stress tested by MSPWAVES-AUDIENCE, I plan to add more gifs and maybe add a few more commends so it is less basic. I would love to have a command to pull a random image from NFT Showroom but so far I haven't found an easy way to do that!

This has been a pretty fun learning experience, mildly frustrating but since Kawaii bot died it had to be done!

+hug

>>>>>>>>>>>>>₳ⱠłɆ₦ ⱧØ₦ɆɎ<<<<<<<<<<<<<

Join the Alien Art Hive community and come get some Alien Honey!

ALIEN DISCORD

To follow on twitter, personal account, Alien Community account <3



0
0
0.000
5 comments
avatar

I'm glad you had fun doing it.

Show the world that even a newbie could do it pretty quickly.

0
0
0.000
avatar

Yeah, I definitely hit a few tricky parts and actually had to push some fixes yesterday but overall if I was able to do it I think anyone can :)

0
0
0.000
avatar

No links to help other noobs get started. Need to test my google foo....🙃

0
0
0.000
avatar

I mostly used this one to make the bot:

and this one to host on heroku:

but I had to google a lot of things along the way to troubleshoot or clarify and sadly did not save all the links. I probably had about 100 tabs open at one point 😂

0
0
0.000