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

Suggestion: send photos #3

Closed
SimonLeclere opened this issue Aug 22, 2020 · 1 comment
Closed

Suggestion: send photos #3

SimonLeclere opened this issue Aug 22, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@SimonLeclere
Copy link

SimonLeclere commented Aug 22, 2020

Integrate this into the send() function or create another function

@Androz2091 Androz2091 added the enhancement New feature or request label Aug 22, 2020
@Androz2091 Androz2091 changed the title Suggestion : Possibilité d'envoyer des photos Suggestion: send photos Aug 22, 2020
@Androz2091
Copy link
Owner

This is now available with v1.2.0 ✅

const fetch = require('node-fetch');

client.on('messageCreate', async (message) => {
    if (message.authorID === client.user.id) return

    if (message.content === '!image') {
        const res = await fetch('https://via.placeholder.com/150')
        const buffer = await res.buffer()
        message.chat.sendPhoto(buffer)
    }
})

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

No branches or pull requests

2 participants