Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

fix: only adjust member count if guild is found #742

Merged
merged 2 commits into from
Jan 1, 2023

Conversation

AstreaTSS
Copy link
Contributor

What type of pull request is this?

  • Non-breaking code change
  • Breaking code change
  • Documentation change/addition
  • Tests change
  • CI change
  • Other: [Replace with a description]

Description

I don't quite have an idea on how it happened, but according to a message in the NAFF Discord server, sometimes, when a member is removed from a guild, the guild they were removed from isn't in the cache and causes the processor to fail.

This PR causes the processor to not error, at the very least.

Changes

  • Only change guild.member_count if guild isn't None in MemberEvents.

Checklist

  • I've formatted my code with Black
  • I've added docstrings to everything I've touched
  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x
  • I've tested my changes
  • I've added tests for my code - if applicable
  • I've updated the documentation - if applicable

@LordOfPolls LordOfPolls merged commit b2f7632 into NAFTeam:dev Jan 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants