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

Improve how sending messages works #1451

Closed
wants to merge 1 commit into from
Closed

Conversation

amishshah
Copy link
Member

Please describe the changes this PR makes and why it should be merged:
This is a WIP PR so I will fill this in later

Semantic versioning classification:

  • This PR changes the library's interface (methods or parameters added)
    • This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
  • This PR only includes non-code changes, like changes to documentation, README, etc.

Suggestions / Roadmap:

  • Add an Attachment class to allow for:
// single files
channel.send(new Attachment(file, 'image.jpg'));
// multiple files
channel.send([
  new Attachment(file, 'image.jpg'),
  new Attachment(file2, 'image2.jpg'),
]);

  • Add content as a valid property of MessageOptions

  • Allow directly sending RichEmbed objects:
channel.send(new RichEmbed(...));

@Hackzzila
Copy link
Contributor

Why not also do something like this?

// Sends a file
channel.send(buffer);
// ex
channel.send(fs.readFileSync('foobar'));

// Sends normal content
channel.send(buffer.toString());

// Sends a file
channel.send(readStream);
// ex
channel.send(fs.createReadStream('foobar'));

@devsnek
Copy link
Member

devsnek commented May 18, 2017

content is a valid property of message options after #1490 gets merged

@iCrawl iCrawl added this to the 12.0.0 milestone Jul 22, 2017
@Lewdcario Lewdcario mentioned this pull request Jul 29, 2017
3 tasks
@iCrawl
Copy link
Member

iCrawl commented Aug 1, 2017

#1731

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants