Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guildsync: Add verbose reason for role removal #140

Open
brybrant opened this issue Jun 10, 2023 · 0 comments
Open

Guildsync: Add verbose reason for role removal #140

brybrant opened this issue Jun 10, 2023 · 0 comments

Comments

@brybrant
Copy link
Contributor

async def remove_roles(self, roles):
try:
coro = self.member.remove_roles(*roles, reason="$guildsync")
await asyncio.wait_for(coro, timeout=5)
except (asyncio.TimeoutError, discord.Forbidden):
pass

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"
  },
  {}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant