LeaPhant / flowabot

Modular Discord bot with fun features including twitch commands and advanced osu! commands. 🌷

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a way to limit max !render length

shrublet opened this issue · comments

commented

I'm sure it's not too difficult to implement, I'm just mega stupid :( Would be great since personally I've been running this off a very low-powered web server so bandwidth is small and the bot totally hangs if people try to render more than 10 seconds.

You could insert the following code into this line https://github.com/LeaPhant/flowabot/blob/master/commands/render.js#L142:

length = Math.min(length, 10);

This will force the length to not go above 10 seconds. :)

You could insert the following code into this line https://github.com/LeaPhant/flowabot/blob/master/commands/render.js#L142:

length = Math.min(length, 10);

This will force the length to not go above 10 seconds. :)

it doesn't work for me like that. I don't know if I've done it wrong, but it won't work.
image

You could insert the following code into this line https://github.com/LeaPhant/flowabot/blob/master/commands/render.js#L142:

length = Math.min(length, 10);

This will force the length to not go above 10 seconds. :)

it doesn't work for me like that. I don't know if I've done it wrong, but it won't work.
image

workaround:

change length = parseFloat(arg); to length = Math.min(parseFloat(arg),60); in line 117 on commands/render.js
dont forget to change 60 to any value you want in seconds

image

image

image

thank you! it worked alright!