New discord Poll detection
is it possible to detect if a message is actually a poll (new discord poll) via API?
12 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!Raw API, yes. Djs currently don't support it.
I think it's in
APIMessage
or something.not through DJS directly, but on the API yes, messages with a poll in them have a new
poll
property that contains everything relating to the poll
how can i access this data? its not included in the messageCreate message data
well of course, because DJS doesn't support it yet but the data is there on the API directly
alright i just used events.raw to detect a poll
GitHub
feat: polls by almeidx · Pull Request #10185 · discordjs/discord.js
Please describe the changes this PR makes and why it should be merged:
Added support for polls.
Upstream:
discord/discord-api-docs#6746
Depends on:
discordjs/discord-api-types#925
Status and ve...
dont spoonfeed
also that can quickly get bot ratelimited
no i mean fetching message part
don't need to do that, listen for raw/the dispatch event on client#ws, match the event and make the delete rest call
that fetch not being associated with the rest instance, so not respecting rate limits is a huge issue
Definitely seems like a clunky workaround yeah. I worked my way through the raw event and figured out a way to detect a poll, timeout the poster, and delete the poll, in my own script.
lol, timeout anyone who makes a poll
it's immensely funny to see how people overreact over polls
I mean it's a one minute timeout to dissuade spamming them
I have a server with ~11k people in it and we use automod, which seems not to work in polls. I'd just as soon disallow polls, but Discord as usual decided not to provide a functional permission for this feature.
Sometimes if you want something to work right you just have to do it yourself.