Skip to content

Existing offensive messages sometimes posted again #1099

@MarkKoz

Description

@MarkKoz

Sentry Issue: BOT-6B

My guess is this happens when an edited message re-triggers a filter. If this is indeed the case, then the error can simply be ignored.

ResponseCodeError: Status: 400 Response: {'id': ['offensive message with this id already exists.']}
(1 additional frame(s) were not displayed)
...
  File "bot/cogs/filtering.py", line 143, in on_message_edit
    await self._filter_message(after, delta)
  File "bot/cogs/filtering.py", line 304, in _filter_message
    await self.bot.api_client.post('bot/offensive-messages', json=data)
  File "bot/api.py", line 127, in post
    return await self.request("POST", endpoint, raise_for_status=raise_for_status, **kwargs)
  File "bot/api.py", line 114, in request
    await self.maybe_raise_for_status(resp, raise_for_status)
  File "bot/api.py", line 104, in maybe_raise_for_status
    raise ResponseCodeError(response=response, response_json=response_json)

Unhandled exception in on_message_edit.

Metadata

Metadata

Assignees

Labels

a: filtersRelated to message filters: (antimalware, antispam, filtering, token_remover)p: 3 - lowLow Priorityt: bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions