LeaPhant / flowabot

Modular Discord bot with fun features including twitch commands and advanced osu! commands. 🌷
MIT License
111 stars 33 forks source link

a way to limit max !render length #37

Closed shrublet closed 4 years ago

shrublet commented 4 years ago

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.

LeaPhant commented 4 years ago

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. :)

JuanM4T commented 3 years ago

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

nekoraw commented 3 years ago

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

JuanM4T commented 3 years ago

thank you! it worked alright!