Commit graph

50 commits

Author SHA1 Message Date
97050f0cf1
Attempt to move image processing to an eris-fleet service 2021-07-05 19:20:21 -05:00
ecc6d98aec
Added sqlite database support, connect new argument parser to message handler 2021-07-01 23:42:12 -05:00
41c8be04cf Added gif, detect if any image servers are disconnected 2021-06-28 17:59:05 -05:00
0fbc165154
Delete unfinished jobs on connection close 2021-06-27 17:06:52 -05:00
137120b4b7
Make connect into an async function 2021-06-26 20:58:22 -05:00
da8c676320
Changed image size limit 2021-06-19 15:11:34 -05:00
4d3e1655e0
A little bit more image work 2021-06-18 19:10:13 -05:00
a0a32c31b9
Switched image API from raw TCP to websockets, removed selective image reading code 2021-06-18 00:10:11 -05:00
52d91b752d
Added snapchat, prevent image queue packet from being sent twice 2021-06-14 22:03:48 -05:00
bd221d5909
Make command error logs more verbose, image server connection/job error handling changes 2021-06-01 20:27:28 -05:00
32a470aec3
Change "close" connection event to "end" 2021-05-23 17:22:31 -05:00
96f8ec6353
Make soundreload apply to all clusters 2021-05-22 10:10:42 -05:00
7aa684eae6
Export jobs, removed unused opcode 2021-05-17 22:37:40 -05:00
cb6e1b5f36
Try another method for handling broken connections 2021-05-17 19:08:06 -05:00
b748e54437
Delete jobs when disconnecting from image servers 2021-05-17 15:39:22 -05:00
82ab3f672f
Trying to reduce cannot call write errors 2021-05-17 14:23:29 -05:00
21a98e216d
Acccount for cases where Content-Range doesn't exist 2021-05-14 22:02:50 -05:00
d5c7b38b57
None of these were needed in the first place 2021-05-11 12:11:54 -05:00
c4b57ac617 Re-add a form of size limit 2021-05-11 11:22:27 -05:00
2b810c7c86 Re-add image job timeout, split dockerfiles, removed api from docker-compose, more fixes 2021-05-10 22:59:19 -05:00
198b6dbcac Fixed potential issue where all jobs could be deleted 2021-05-06 16:58:35 -05:00
e8834c072a Properly handle closing an image server connection, switch some "on" instances to "once" 2021-05-06 16:40:05 -05:00
6cecd4b9d6 Make all native image functions synchronous 2021-04-24 17:54:47 -05:00
c67499af9d Added initial support for detecting videos, prevent music messages from showing on soundboard commands, fixed(?) permission checking 2021-04-19 09:31:39 -05:00
40223ec8b5
Class commands, improved sharding, and many other changes (#88)
* Load commands recursively

* Sort commands

* Missed a couple of spots

* missed even more spots apparently

* Ported commands in "fun" category to new class-based format, added babel eslint plugin

* Ported general commands, removed old/unneeded stuff, replaced moment with day, many more fixes I lost track of

* Missed a spot

* Removed unnecessary abort-controller package, add deprecation warning for mongo database

* Added imagereload, clarified premature end message

* Fixed docker-compose path issue, added total bot uptime to stats, more fixes for various parts

* Converted image commands into classes, fixed reload, ignore another WS event, cleaned up command handler and image runner

* Converted music/soundboard commands to class format

* Cleanup unnecessary logs

* awful tag command class port

* I literally somehow just learned that you can leave out the constructor in classes

* Pass client directly to commands/events, cleaned up command handler

* Migrated bot to eris-sharder, fixed some error handling stuff

* Remove unused modules

* Fixed type returning

* Switched back to Eris stable

* Some fixes and cleanup

* might wanna correct this

* Implement image command ratelimiting

* Added Bot token prefix, added imagestats, added running endpoint to API
2021-04-12 11:16:12 -05:00
5d2e2b5274 Upgraded retrotext and DBL posting packages, fixed mention prefixes and DM commands 2021-03-18 09:29:03 -05:00
4c83c55344 supposedly async promises are bad lmao 2021-03-15 22:29:48 -05:00
62346cbae4 Rework image API again, replaced many calls to replace with replaceAll 2021-01-18 14:11:28 -06:00
adroitwhiz
3de4858b5a
Clean up image API code paths (#49)
* Document image.js a bit

* Close image.js sockets in all code paths

I'm not sure whether sockets get GC'd when the function returns

* Remove getFormat

It was only called from one place, and the object property names were
quite confusing

* Clean up image.js conditional a bit

I had to write out an entire truth table for this and work it all out
Thinking hard

* Move actual ImageMagick calling into separate file

This gets rid of the weird, brain-melting ouroboros of code that
recurses across threads and processes.

* Reduce amount of getType wrangling

This amounted to an awful lot of dead conditionals after the image
commands were all modified to pass in image types anyway. This has also
led to two different implementations diverging, which causes bugs like
GIF commands applied to non-GIFs erroring instead of providing a
user-friendly message.

* Unify image-runner return type, clarify image type

This allows us to remove the fromAPI parameter from image-runner, and
helps greatly clarify the behavior around image types.

* Deduplicate GIF code, fix "not a GIF" handling

The special "nogif" value is now stored as the image type instead of its
value, as the value must always be a Buffer now--no loosely-typed
shenanigans.
2021-01-09 19:50:29 -06:00
c2bd68263b Made image API node chooser sort by job amount instead of CPU usage, added soundreload 2021-01-08 12:08:10 -06:00
2a3f84f628 Properly request only the first 1024 bytes when getting image type 2021-01-04 11:10:57 -06:00
dd114e27b5 Added more activity messages, updated packages, allow any public Lavalink instance to be used via the "local" parameter, added clearer error message for API timeouts 2021-01-04 10:29:18 -06:00
8a2d4e6669 Fixed image API request closing prematurely, disabled music commands in production, various fixes regarding direct messages, fixed reply image checking, and removed yoda 2020-12-26 12:17:10 -06:00
7a254a5139 Added load-based api node selection 2020-12-25 20:27:45 -06:00
ef945adf09 Added support for using both MongoDB and PostgreSQL, changed image api timeouts, removed all moderation commands 2020-12-17 20:32:19 -06:00
69d8100f23 Actually made screenshot owner-only, made image API interaction more secure 2020-12-14 12:39:18 -06:00
59dec7f857 Made image functions run on a worker thread when the API is disabled 2020-11-26 11:48:19 -06:00
ca6cffa67c Some security fixes 2020-11-20 15:16:52 -06:00
ad149156ad Switched to an image API implementation by Terradice 2020-11-17 08:52:12 -06:00
6761e39d70 A little bit of cleanup 2020-11-09 22:09:57 -06:00
Samuel Hernandez
66cf9dc518
utils/image.js: fix getType on local files 2020-11-07 20:50:32 -05:00
0600cf230f Caption now supports more unicode characters, more api work, fixed multiple bugs 2020-11-05 15:40:18 -06:00
a03d3a5e79 Fixed GIF commands for real (lol) 2020-10-19 20:24:53 -05:00
cf5c649384 Heavy work on the image detection code, fixed mention prefixes not being properly registered 2020-10-18 16:53:35 -05:00
ac4e1f5dd8 Simplified and fixed image API, updated packages 2020-10-06 14:48:22 -05:00
925eb387dd Fixed issue with skip vote counts, added headless chrome IP to config, other fixes 2020-09-18 19:54:52 -05:00
4caec5aefa Fixed characters not being properly encoded, fixed images not being properly appended, more fixes 2020-09-09 21:36:20 -05:00
a6137436d2 The bot can now actually interact with the API, fixed issues relating to leaving voice channels 2020-09-01 21:52:12 -05:00
c471bd8af8 Preliminary DM support, update URLs to point to new repo link 2020-09-01 17:10:19 -05:00
f415b3bb09 Changed image function syntax, improved dice, switched to fs.promises, might have also done other stuff but idk 2020-08-27 21:34:12 -05:00