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

channel.messages.fetch(messageId) throw 'Missing Access' #203

Closed
3 tasks done
websharik opened this issue Jul 14, 2022 · 12 comments
Closed
3 tasks done

channel.messages.fetch(messageId) throw 'Missing Access' #203

websharik opened this issue Jul 14, 2022 · 12 comments
Labels
bug Something isn't working

Comments

@websharik
Copy link
Contributor

websharik commented Jul 14, 2022

Which package has the bugs?

The core library

Issue description

channel.messages.fetch(messageId) throw 'Missing Access'

Some reason to use another endpoint
91b5be5#commitcomment-70292157

Code sample

channel.messages.fetch(messageId)
// Request /guilds/*/messages/search?channel_id=*&max_id=*&min_id=*
// return 403 with 'Missing Access'

channel.messages.fetch({limit:1, around: messageId})
// Will request as /channels/*/messages?around=msg_id&limit=1
// Works fine

Package version

2.3.74

Node.js version

16.13.1

Operating system

Win 10

Priority this issue should have

Medium (should be fixed soon)

Checklist

  • I have searched the open issues for duplicates.
  • I have shared the entire traceback.
  • I am using a user token (and it isn't visible in the code).

Additional Information

No response

@websharik websharik added the bug Something isn't working label Jul 14, 2022
@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Jul 14, 2022

if it works, and you know how to fix them, create a PR. I'm looking forward to it
I'm busy, so I won't be able to fix them right now

@aiko-chan-ai
Copy link
Owner

@websharik i tested the Endpoint API using postman
Maybe the 403 error is because you don't have access to the channel
With the query around (which is a huge error in results, when it can't find an exact message)
You edit like fb6ab3f, I will leave this issue open
Let me know the result (worked or not)

If it works, it will be in the official version later (after I fix some bugs about events)

@aiko-chan-ai aiko-chan-ai reopened this Jul 14, 2022
@aiko-chan-ai
Copy link
Owner

aiko-chan-ai commented Jul 15, 2022

actually i should ask you about your code, selfbot permission to the channel you are using to search, not removing the channel_id param from search (because removing channel_id will cause a skewed result)

@websharik
Copy link
Contributor Author

websharik commented Jul 15, 2022

@aiko-chan-ai

My SelfBot absolutly have access to the channel with message (i was try type to channel with discord client).

Query without channel_id return total_results: 0 and then throw:
2022-07-15_14-31-21

Yep, around sometimes return wrong message (without not found), we can resolve it with second check:

if (data && data[0].id === messageId)

@aiko-chan-ai
Copy link
Owner

Qury without channel_id return total_results: 0

pls add channel_id back, and let me know the result (it seems that message id is not correct)

@websharik
Copy link
Contributor Author

websharik commented Jul 15, 2022

Id is too absolutly correct because around return right message.

Result with channel_id:
2022-07-15_14-50-32

@aiko-chan-ai
Copy link
Owner

min_id, max_id, channel_id
image
limit, around
image

i tried doing them using postman, and it's better to use channel_id. You need to make sure that the message is the correct id, and the right channel
If sb has full permissions, the message not found (even though it's checked to be correct) is probably due to a faulty Discord API, you should try in another server

@aiko-chan-ai
Copy link
Owner

@websharik i think sb doesn't have VIEW_CHANNEL permission to target channel

@websharik
Copy link
Contributor Author

Found.... Channel has nsfw: true. After disable error gone.

But client.user.nsfwAllowed = true and discord client no problems to show messages and type.
So question - why 'Missing Access' ? How get message from nsfw channel ?

@aiko-chan-ai
Copy link
Owner

Found.... Channel has nsfw: true. After disable error gone.

But client.user.nsfwAllowed = true and discord client no problems to show messages and type. So question - why 'Missing Access' ? How get message from nsfw channel ?

I will try

@websharik
Copy link
Contributor Author

websharik commented Jul 15, 2022

I was created new account with 100% datebirtthday > 18+ and same get 'Missing Access'.

@aiko-chan-ai
Copy link
Owner

@websharik update v2.3.76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants