Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

delete_chat_messages 404 error #458

Closed
AI-Maria opened this issue Jun 25, 2024 · 1 comment
Closed

delete_chat_messages 404 error #458

AI-Maria opened this issue Jun 25, 2024 · 1 comment
Labels

Comments

@AI-Maria
Copy link

Traceback (most recent call last):
  File "/opt/miniconda3/envs/mar/lib/python3.11/site-packages/twitchio/client.py", line 208, in wrapped
    await func(*args)
  File "/home/denis/code/MariaAI/Chat/Chat.py", line 557, in event_message
    await chatter_user.delete_chat_messages(APP_SECRET, self.user_id, m.id)
  File "/opt/miniconda3/envs/mar/lib/python3.11/site-packages/twitchio/user.py", line 1322, in delete_chat_messages
    await self._http.delete_chat_messages(
  File "/opt/miniconda3/envs/mar/lib/python3.11/site-packages/twitchio/http.py", line 1078, in delete_chat_messages
    return await self.request(Route("DELETE", "moderation/chat", query=q, token=token))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/mar/lib/python3.11/site-packages/twitchio/http.py", line 154, in request
    body, is_text = await self._request(route, path, headers, force_app_token=force_app_token)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/miniconda3/envs/mar/lib/python3.11/site-packages/twitchio/http.py", line 253, in _request
    raise errors.HTTPException(f"Failed to fulfill the request", reason=resp.reason, status=resp.status)
twitchio.errors.HTTPException: 404: Failed to fulfill the request: Not Found

My simplified code:

username = ''
APP_SECRET = ''

class Bot(commands.Bot):
    def __init__(self):
        super().__init__(token=APP_SECRET, prefix='?', initial_channels=[username])

    async def event_message(self, message):
        m = message
        chatter_user = await m.author.user()
        await chatter_user.delete_chat_messages(APP_SECRET, self.user_id, m.id)
Copy link

Hello! Thanks for the issue. If this is a general help question, for a faster response consider joining the official Discord Server

Else if you have an issue with the library please wait for someone to help you here.

@PythonistaGuild PythonistaGuild locked and limited conversation to collaborators Jun 25, 2024
@IAmTomahawkx IAmTomahawkx converted this issue into discussion #459 Jun 25, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants