GW2Bot icon indicating copy to clipboard operation
GW2Bot copied to clipboard

Guildsync: Add verbose reason for role removal

Open brybrant opened this issue 1 year ago • 0 comments

https://github.com/Maselkov/GW2Bot/blob/9998f3d84147670ab54d56a8d35643ed103645b9/guildwars2/guild/sync.py#L326-L331

A player was recently kicked from my guild, but my Discord server audit log says "$guildsync" as the reason for the role removal. It would be great if the reason could be more specific; did the player leave the guild or were they kicked? This can be checked with the guild log endpoint ( https://wiki.guildwars2.com/wiki/API:2/guild/:id/log )

When a player is removed from a guild, the reason ( "type" field ) is always "kick". If a player leaves a guild, their account name is in the "user" field and "kicked_by" field. Example:

[
  {},
  {
    "id": 123456,
    "time": "2023-06-10T00:00:00.000Z",
    "type": "kick",
    "user": "example.1234",
    "kicked_by": "example.1234"
  },
  {}
]

If a player is kicked by someone else, it appears as you would expect:

[
  {},
  {
    "id": 654321,
    "time": "2023-06-10T00:00:00.000Z",
    "type": "kick",
    "user": "example.1234",
    "kicked_by": "someone.5678"
  },
  {}
]

brybrant avatar Jun 10 '23 19:06 brybrant