1 year 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

The combat system is already being implemented and there are also some advances with the environment (WIP)

#gamedev #indiedev #godot

We’re excited to announce that we’re working on a new game, a 3D metroidvania with a Low Poly Pixel Art style. Stay tuned for more updates!!!

#gamedev #indiedev #pixelart

Zombie in action! #GameDev #Art #PixelArt

Today I was setting up the location of the first boss. His name is "Father" and he is the first of the Patagonians. His task is to guard the road to the House.🛡🗡 Bookmark pre-launch page🔖🔖🔖

https://www.kickstarter.com/projects/rdvindiegame/the-patagonian…

Protege el conocimiento, salva la historia. Guardian of Lore es un platformer 2D en el que debes luchar para mantener viva la memoria de la mitología latinoamericana. El juego llegará a Steam el 18 de mayo: https://steam.pm/app/1211740 #ScreenshotSaturday

In the quest for accessibility, I'm adding Resurrection Shrines for players on the 'novice' end of the platforming spectrum.

In order to unlock the power of a Shrine, you must collect 3 'Souls' from your dead corpses! (the floating blue orbs)

A Shiny Mega Gengar 🌟 For @ManutkArt 's #ThreeColorsChallenge!

Horror WIP A track that will be featured in a future horror game soundtrack! Stay tuned!

Likes appreciated ✌️

#gamedev #composer #horrorgame #indiegame #IndieGameDev #soundtrack

Showing off player 2 😎

What do you think?

brung back my old oc plus a new one

...they don`t have names yet tho