Skip to content

Commit

Permalink
user_id, server_id = uid, sid
Browse files Browse the repository at this point in the history
  • Loading branch information
Xithrius committed Sep 17, 2023
1 parent d373729 commit b9736ec
Show file tree
Hide file tree
Showing 6 changed files with 195 additions and 182 deletions.
168 changes: 88 additions & 80 deletions pdm.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion xythrion/bot/extensions/core/trusted.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@dataclass
class TrustedData:
id: int
uid: int
user_id: int
at: datetime


Expand Down
2 changes: 1 addition & 1 deletion xythrion/bot/extensions/games/drg/builds.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ async def create_build(
self, ctx: Context, dwarf_class: str, build: str, overclock: str | None
) -> None:
data = {
"uid": ctx.author.id,
"user_id": ctx.author.id,
"dwarf_class": dwarf_class,
"build": build,
"overclock": overclock,
Expand Down
12 changes: 6 additions & 6 deletions xythrion/bot/extensions/mapping/link_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
@dataclass
class LinkMapData:
id: int
sid: int
uid: int
server_id: int
user_id: int
created_at: datetime
from_match: str
to_match: str
Expand All @@ -26,7 +26,7 @@ def __init__(self, bot: Xythrion):

@Cog.listener()
async def on_message(self, message: Message) -> None:
data = {"sid": message.guild.id, "uid": message.author.id}
data = {"server_id": message.guild.id, "user_id": message.author.id}

rows: list[LinkMapData] = await self.bot.api.get("/v1/link_map/", params=data)

Expand All @@ -49,8 +49,8 @@ async def create_link_map(
) -> None:
data = {
"created_at": ctx.message.created_at.replace(tzinfo=None),
"sid": ctx.guild.id,
"uid": ctx.author.id,
"server_id": ctx.guild.id,
"user_id": ctx.author.id,
"from_match": from_match,
"to_match": to_match,
}
Expand All @@ -59,7 +59,7 @@ async def create_link_map(

@link_map.command()
async def get_user_link_maps(self, ctx: Context) -> None:
data = {"sid": ctx.guild.id, "uid": ctx.author.id}
data = {"server_id": ctx.guild.id, "user_id": ctx.author.id}

j = await self.bot.api.get("/v1/link_map/", params=data)

Expand Down
12 changes: 6 additions & 6 deletions xythrion/bot/extensions/mapping/web_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
@dataclass
class WebMapData:
id: int
sid: int
uid: int
server_id: int
user_id: int
created_at: datetime
matches: str
xpath: str
Expand All @@ -42,7 +42,7 @@ def get_first_url(message: str) -> str | None:

@Cog.listener()
async def on_message(self, message: Message) -> None:
data = {"sid": message.guild.id, "uid": message.author.id}
data = {"server_id": message.guild.id, "user_id": message.author.id}

rows: list[WebMapData] = await self.bot.api.get("/v1/web_map/", params=data)

Expand All @@ -67,8 +67,8 @@ async def web_map(self, ctx: Context) -> None:
@web_map.command()
async def create_web_map(self, ctx: Context, matches: str, xpath: str) -> None:
data = {
"sid": ctx.guild.id,
"uid": ctx.author.id,
"server_id": ctx.guild.id,
"user_id": ctx.author.id,
"created_at": ctx.message.created_at.replace(tzinfo=None),
"matches": matches,
"xpath": xpath,
Expand All @@ -78,7 +78,7 @@ async def create_web_map(self, ctx: Context, matches: str, xpath: str) -> None:

@web_map.command()
async def get_user_web_maps(self, ctx: Context) -> None:
data = {"sid": ctx.guild.id, "uid": ctx.author.id}
data = {"server_id": ctx.guild.id, "user_id": ctx.author.id}

j = await self.bot.api.get("/v1/web_map/", params=data)

Expand Down
Loading

0 comments on commit b9736ec

Please sign in to comment.