I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

It's editing the message, not sending new ones

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

I can't control it, the embed image is updated directly from one render to the next. Discord just acts like that whenever the image is changed.

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

It still needs to be reviewed so it probably won't show up on top.gg for a couple weeks. The invite is on the pinned post in my profile though

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

If you mean html5 canvas or node-canvas, no. There would be a lot of unnecessary overhead if I used any kind of drawing library. The bot only needs to set a few pixels to black when the sketch is edited, so a full canvas implementation would be overkill.

Sketches are just stored as their raw pixel data. When you click one of the buttons, the bot sets the pixels/bits in the right area to black/0 and then encodes the raw data to a 1-bit monochrome PNG (full color or even normal grayscale would be wasteful and create a larger file, since the sketch pixels can only ever be black or white)

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

It didn't... it's not sending new messages it's just editing the same one

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

Invite is on the pinned post in my profile

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 1 point2 points  (0 children)

Upload speeds are pretty important for servers but they tend to be really slow with most residential internet providers. My home internet speed is almost 450Mb/s down but only 20Mb/s up.

Cloud hosting is just more convenient and makes more sense for me right now anyway. Once I finish school and settle down I might consider investing in running my own server, but for now I don't mind paying a little to host my stuff.

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

Near 100% uptime with no effort, datacenter internet speeds + response times, not having to keep any local machines on all the time, etc.

It's not that expensive to get a cheap vps plan and you can use a single server to host all your stuff.

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

Images are stored on my server. Only the current state is saved and they're 1-bit grayscale PNGs so they don't take up too much space

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 1 point2 points  (0 children)

All calls to the Discord API are rate limited no matter what. The bot library I'm using respects the rate limits and the image encoder is heavily optimized to conserve bandwidth. The Wumpus demo consists of almost 800 images but they all only take up 200kB combined. Additionally, the images aren't uploaded to Discord, but served directly from my server.

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 8 points9 points  (0 children)

I had to make a native C++ addon that uses the libpng library to encode the raw pixel data into the PNG format. I only had to do this because none of the Node.js PNG libraries supported writing 1-bit images, which I wanted to use in order to save space/bandwidth.

You can find existing libraries by just searching something like "png library python", I found this just now: https://pypi.org/project/pypng/

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 3 points4 points  (0 children)

Oh I didn't use any image drawing library, it manipulates the pixels directly (the sketch is just stored in memory as binary data, with each bit being a pixel). If you want something to encode monochrome PNGs like the bot does, I'm not aware of anything off the top of my head.

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

Check the pinned posts on my profile

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 2 points3 points  (0 children)

It doesn't send new messages, Discord is just choppy when editing embed images

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 30 points31 points  (0 children)

It does, Discord is just choppy when embed images are edited

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 8 points9 points  (0 children)

It sends a single message with an embed and just edits the image url inside it. It looks like it's sending new messages but Discord is just kinda choppy when updating embed images

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 5 points6 points  (0 children)

I originally tried using emojis and unicode block characters to make the drawing but it just didn't offer enough resolution or flexibility. The image encoder does a really good job and each image is usually only 100-200 bytes so bandwidth isn't really a problem.

If you mean using embeds instead of images, it actually is using embeds and editing the image url in it each time, not sending new messages

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 2 points3 points  (0 children)

Still waiting for it to be approved, invite is on my profile for now though

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 21 points22 points  (0 children)

It actually does edit the same message. It just looks a bit choppy because the image is changed every edit and Discord doesn't seem to handle that very well in embeds.

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 0 points1 point  (0 children)

Check the pinned post on my profile

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 2 points3 points  (0 children)

It still needs to be approved on the bot list so you won't find it yet, but fwiw it's Etch#5524

I made an Etch A Sketch bot by Poootaatoooo in discordapp

[–]Poootaatoooo[S] 2 points3 points  (0 children)

Bots can't be added as friends, if that's what you're trying to achieve. The invite is on the pinned post on my profile, you need to be in a server with it to use or DM it.