2 years ago

Got Bored so I made a Discord Bot in Godot.

This was made WITHOUT any pre-made libraries.

The data is stored in a json file (Image 2), the censored bit is my Discord UserID. I censored it so I dont get random Friend Requests.

V READ ARTICLE V


First of all. I will NOT Finish this, as I'm too lazy to figure out some required bot stuff, and make it fancy and whatnot, I will however; probably continue to experiment with discord's api.

to make this, I looked over a small tutorial on how to use Discord's Websocket "APP" API in Godot, and then translated it from Godot 3 (which is what the tutorial was written in) to Godot 4 (which is the version I'm using)

Literally just uses Discord's basic v10 api websocket... nothing all to special.

Storing the data is also extremely simple, here's the code snippets.

This is for the addmoney command

image.png

message_content is what it says.

prefix is "!"

message_to_send describes what to respond with.

jsondata loads the userdata from a json file.

authorid is the userid of the message author / sender.

ye, I'm not making a whole tutorial for this.

and this is for the money command

image.png

it lets you know just how rich you are lol

pretty much uses the same stuff as before, but instead of overriding and saving, it just loads the json for its data and then calls it via jsondata[authorid]["money"]

well... unless you're not registered in the database, in which case it will just tell you that you have 0$ and create your userid in the database, setting it to 0$ at default.



26 comments

Loading...

Next up

A quick look at Ryn: And the thread of Life, our game in development, platforms and traps in action.

#gamedev #indiedev #godot

A little random gameplay of our new game Ryn and the Thread of Life

Here's the last two attacks for Augusto! First we have a spinning charge, then a foot claw swipe if you get too close.

We made a lot of improvements on the Freezing Plains visual. Things like pine trees, tiny bushes, some rocks, and others game props!

#IndieGame | #IndieDev | #GameDev | #PixelArt | #WaifuQuest | #WifeQuest | #screenshotsaturday

Successful landing

#screenshotsaturday

Enemies can also suddenly spawn through Realm Rifts. These Rift Spawns are going to be stronger than the ones wandering around. TBD on the enemies... #screenshotsaturday #godstear #madewithunity

Have a good Boi

Werehog transformation process. #sonicunleashed

Regional Bulbasaur. #Pokemon

Our menu, gathered a huge feedback and positive comments among foreign audience, what you say? Game Steam: https://store.steampowered.com/app/1543090/LiBER/