Skip to content

Commit

Permalink
Posts now work with datetimes
Browse files Browse the repository at this point in the history
  • Loading branch information
Xithrius committed Jul 10, 2023
1 parent 9394447 commit 5177bc0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions xythrion/extensions/mapping/link_maps.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import json

from discord.ext.commands import (
Cog,
group,
Expand All @@ -20,14 +22,17 @@ async def link_map(self, ctx: Context) -> None:

@link_map.command()
async def create_link_map(self, ctx: Context) -> None:
data = {
"created_at": ctx.message.created_at.replace(tzinfo=None),
"sid": ctx.guild.id,
"uid": ctx.author.id,
"from_match": "asdf",
"to_match": "fdsa",
}

await self.bot.http_client.post(
"http://localhost:8000/link_map",
json={
"sid": ctx.guild.id,
"uid": ctx.author.id,
"from_match": "asdf",
"to_match": "fdsa",
},
data=json.dumps(data, default=str),
)

# async def execute_add_remap(
Expand Down

0 comments on commit 5177bc0

Please sign in to comment.