changed budget type to float instead of string

This commit is contained in:
phixxy 2024-03-16 00:42:58 -07:00
parent 20154d8ec4
commit 6097ee1415

View file

@ -128,13 +128,13 @@ class ChatGPT(commands.Cog):
try: try:
if ctx.author.id == self.admin_id: if ctx.author.id == self.admin_id:
if command == "add" and budget!= None: if command == "add" and budget!= None:
self.dalle_budget += budget self.dalle_budget += float(budget)
await ctx.send(f"Budget increased by {budget}") await ctx.send(f"Budget increased by {budget}")
elif command == "remove" and budget!= None: elif command == "remove" and budget!= None:
self.dalle_budget -= budget self.dalle_budget -= float(budget)
await ctx.send(f"Budget decreased by {budget}") await ctx.send(f"Budget decreased by {budget}")
elif command == "set" and budget!= None: elif command == "set" and budget!= None:
self.dalle_budget = budget self.dalle_budget = float(budget)
await ctx.send(f"Budget set to {budget}") await ctx.send(f"Budget set to {budget}")
else: else:
await ctx.send(f"The current budget is {self.dalle_budget}") await ctx.send(f"The current budget is {self.dalle_budget}")