diff --git a/bot/pluralkit/commands.py b/bot/pluralkit/commands.py index 6bc6bf42..d56a9719 100644 --- a/bot/pluralkit/commands.py +++ b/bot/pluralkit/commands.py @@ -1,4 +1,4 @@ -from datetime import datetime +from datetime import datetime, timezone import io import itertools import json @@ -6,6 +6,7 @@ import os import re from urllib.parse import urlparse +import dateparser import discord from discord.utils import oauth_url import humanize @@ -464,7 +465,7 @@ async def switch_member(conn, message, args): if len(members) == 1: return False, "{} is already fronting.".format(members[0]["name"]) return False, "Members {} are already fronting.".format(", ".join([m["name"] for m in members])) - + # Log the switch async with conn.transaction(): switch_id = await db.add_switch(conn, system_id=system["id"]) @@ -492,6 +493,70 @@ async def switch_out(conn, message, args): await db.add_switch(conn, system_id=system["id"]) return True, "Switch-out registered." +@command(cmd="switch move", usage="