We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
server/yepcord/yepcord/models/readstate.py
Line 73 in 7dfe87e
"last_message_id": str(self.last_read_id), "id": str(self.channel.id), } @classmethod async def create_or_add( cls, user: models.User, channel: models.Channel, mentions: int = 1, last_read_id: Optional[int] = None, ) -> ReadState: state, created = await cls.get_or_create(user=user, channel=channel, defaults={ "count": mentions, "last_read_id": last_read_id or 0, }) if not created: state.count += mentions state.last_read_id = last_read_id or state.last_read_id await state.save(update_fields=["count", "last_read_id"]) return state @classmethod async def update_from_message(cls, message: models.Message) -> None: if message.channel.type in (ChannelType.DM, ChannelType.GROUP_DM): for user in await message.channel.recipients.filter(id__not=message.author.id): await models.ReadState.create_or_add(user, message.channel) elif message.channel.type in GUILD_CHANNELS: ... # TODO: update read state of mentioned users
The text was updated successfully, but these errors were encountered:
No branches or pull requests
server/yepcord/yepcord/models/readstate.py
Line 73 in 7dfe87e
The text was updated successfully, but these errors were encountered: