made budget args optional
This commit is contained in:
parent
f0dccd2233
commit
20154d8ec4
1 changed files with 4 additions and 4 deletions
|
|
@ -124,16 +124,16 @@ class ChatGPT(commands.Cog):
|
||||||
return (flagged, categories, category_scores)
|
return (flagged, categories, category_scores)
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def budget(self, ctx, command: str, budget: float):
|
async def budget(self, ctx, command=None, budget=None):
|
||||||
try:
|
try:
|
||||||
if ctx.author.id == self.admin_id:
|
if ctx.author.id == self.admin_id:
|
||||||
if command == "add":
|
if command == "add" and budget!= None:
|
||||||
self.dalle_budget += budget
|
self.dalle_budget += budget
|
||||||
await ctx.send(f"Budget increased by {budget}")
|
await ctx.send(f"Budget increased by {budget}")
|
||||||
elif command == "remove":
|
elif command == "remove" and budget!= None:
|
||||||
self.dalle_budget -= budget
|
self.dalle_budget -= budget
|
||||||
await ctx.send(f"Budget decreased by {budget}")
|
await ctx.send(f"Budget decreased by {budget}")
|
||||||
elif command == "set":
|
elif command == "set" and budget!= None:
|
||||||
self.dalle_budget = budget
|
self.dalle_budget = budget
|
||||||
await ctx.send(f"Budget set to {budget}")
|
await ctx.send(f"Budget set to {budget}")
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue