0

I saw the question Send message and shortly delete it, but it the answer uses message.reply which I don't want to.

So I want to send a message and after 5000 ms delete it, but message.channel.send doesn't return a Messageso I can delete it. Is there any send function that returns a Message.

tscpp
  • 1,298
  • 2
  • 12
  • 35
  • Does this answer your question? [Send message and shortly delete it](https://stackoverflow.com/questions/46907207/send-message-and-shortly-delete-it) – Klaycon Jan 31 '20 at 16:57
  • Read the question... – tscpp Jan 31 '20 at 16:59
  • The comment was automatically generated when I flagged this question as a duplicate. I left an answer explaining why the question you linked does, in fact, answer your question too. `message.channel.send` *does* resolve with a Message, if you're having a hard time getting one out of it, then I suggest asking a question showing your code so answerers can diagnose what's going wrong. – Klaycon Jan 31 '20 at 17:01

1 Answers1

1

message.channel.send() returns a Promise<Message>, just like message.reply(). The reply method simply defers to message.channel.send() internally, prepending a mention of the author.

Try it: Use the exact code in the answer to the question you linked. Replace .reply() with .channel.send().

Klaycon
  • 10,599
  • 18
  • 35
  • That was awkward. The reason I didn't see this was because it returns `Promise` and it just showed me `.toString()`. Thanks for your answer. ;) – tscpp Jan 31 '20 at 17:01