every-Bot / everyBot

A discordpy bot for all purposes
GNU Lesser General Public License v3.0
4 stars 3 forks source link

Remove Math Module Commands #13

Open simbarb opened 3 years ago

simbarb commented 3 years ago

Would it be better to remove the add, subtract, multiply and divide commands and just keep the calculate command?

JBrummans commented 3 years ago

I had that thought when making the module. The commands are somewhat redundant. That would leave the Math module pretty empty though.

Givo29 commented 3 years ago

I've actually had second thoughts on the the math module as a whole lately - or at least the way in which it works... It's quite easy to abuse in terms of cpu usage, especially the multiplication and calculation commands, so we may redesign it to offload the calculations to a cloud server of some sort that is designed for this.

As for the redundancy of the commands, I like how they're much quicker to access, especially for mobile users that don't have super fast access to the symbols they need.. a simple $add 1 1 is much quicker

simbarb commented 3 years ago

Taking a step back, is there any use case for having a math module? Would a user be using Discord as a calculator over a native calculator app?

Echoing Givo's comments, moving calculations to a cloud service is a good idea.

Maybe the math module could be moved to more of a common library type role. For example, the dnd module could call the math library which pushes larger calculations to a cloud service to avoid abuse / performance impact. Another example is using it in Discord mini-games, like a text RPG (calculate damage etc).

JBrummans commented 3 years ago

Not opposed to offloading workload to another server. But a short term solution would be some kind of comand timout. If any of these commands take more than a few seconds to process they should be killed and return a timeout error.

Givo29 commented 3 years ago

The math module was originally created because someone in one of my servers requested it, so I thought why not? It's not a bad idea and perhaps with the help of a cloud solution we could be doing more complex things than a basic phone calculator - But that's for more discussion further down the line.

I'm not super sure what you mean by having the dnd module call it