Search code examples
discorderis

How to send a data in the form of a file in a channel using Eris Discord


I have some data in Array. I want it to send the data in a channel in the form of a .json file. How to do that in Eris?


Solution

  • You can find the docs here. So how you would send it in a channel via a file would be

    <Client>.createMessage(<Message>.channel.id, 'Text', {file: {file.name: '<name>.json', file.file: 'Put your array data here'}})
    

    I hope this helped!

    Edit: The past one was wrong. The correct format is

    <Client>.createMessage(<Message>.channel.id, 'Text', {file: {file.name: '<name>.json', file.file: 'Put your array data here'}})