Moved the rotation command to the commands section, renamed it to speedrotation as well as its prompt. Put the dateline import onto the same line as the import. Changed the wording of speedrotation to speak about Speed and not 2nd person.

This commit is contained in:
Speediestsaf 2025-07-24 17:16:21 +00:00
parent c6df7d00d9
commit 4407f71d1f
2 changed files with 36 additions and 36 deletions

View file

@ -7,5 +7,5 @@
"cmd_addcommand": ["addcommand"],
"cmd_listcommands": ["listcommands", "list"],
"cmd_roll": ["roll", "r"],
"cmd_rotation": ["rotation"]
"cmd_speedrotation": ["speedrotation"]
}

View file

@ -125,42 +125,11 @@ async def cmd_roll(ctx, inputValue, sign = None, addition = None):
except ValueError as e:
await ctx.send(f"Invalid input - {e}.")
########################################################
### INTERNAL METHODS - ALL METHODS MUST BE LOWERCASE ###
########################################################
#Loads commands into variable.
def loadcommands(filename):
if not os.path.exists(filename):
with open(filename, "w", encoding="utf-8") as file:
json.dump({}, file) # Create an empty JSON file
with open(filename, "r", encoding="utf-8") as file:
return json.load(file)
#Loads points into variable.
def loadpoints():
if not os.path.exists("points.json"):
with open("points.json", "w", encoding="utf-8") as file:
json.dump({}, file) # Create an empty JSON file
with open("points.json", "r", encoding="utf-8") as file:
return json.load(file)
# Saves points to the points.json file.
def savepoints(points_data):
with open("points.json", "w", encoding="utf-8") as file:
json.dump(points_data, file, indent=4)
#Rolls die for cmd_roll
def rolldie(sides):
return random.randint(1, sides)
# Define the rotation start date (Week 1)
ROTATION_START_DATE = datetime.date(2025, 7, 14)
#@bot.command(name='rotation')
async def cmd_rotation(ctx):
#@bot.command(name='speedrotation')
async def cmd_speedrotation(ctx):
# Get today's date
today = datetime.date.today() # For this example, assume July 24, 2025
@ -193,9 +162,40 @@ async def cmd_rotation(ctx):
# Format the response
response = (
f"You are currently in **Week {current_week}** ({status}).\n"
f"You will be back to working at the office on **{next_week3_monday.strftime('%B %d, %Y')}**."
f"Speed is currently in **Week {current_week}** ({status}).\n"
f"Speed will be back to working at the office on **{next_week3_monday.strftime('%B %d, %Y')}**."
)
# Send the response
await ctx.send(response)
########################################################
### INTERNAL METHODS - ALL METHODS MUST BE LOWERCASE ###
########################################################
#Loads commands into variable.
def loadcommands(filename):
if not os.path.exists(filename):
with open(filename, "w", encoding="utf-8") as file:
json.dump({}, file) # Create an empty JSON file
with open(filename, "r", encoding="utf-8") as file:
return json.load(file)
#Loads points into variable.
def loadpoints():
if not os.path.exists("points.json"):
with open("points.json", "w", encoding="utf-8") as file:
json.dump({}, file) # Create an empty JSON file
with open("points.json", "r", encoding="utf-8") as file:
return json.load(file)
# Saves points to the points.json file.
def savepoints(points_data):
with open("points.json", "w", encoding="utf-8") as file:
json.dump(points_data, file, indent=4)
#Rolls die for cmd_roll
def rolldie(sides):
return random.randint(1, sides)