You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{BotHandler,BotInst,Trigger,$}from"speedybot";consthandlers: BotHandler[]=[{keyword: "<@fileupload>",asynchandler(bot,trigger){const$bot=$(bot);// take 1st file uploaded, note this is just a URL which requires auth to retrieveconst[file]=trigger.message.files;constfilePayload=await$bot.getFile(file,{responseType: "arraybuffer",});const{ data, extension, fileName, type, markdownSnippet }=filePayload;// Do something w/ data here// data: raw file data if relevant// extension: the file's extension// filename: the file's name on harddisk (however uploaded)// type: the file's media type from content header, ex "image/jpeg"},helpText: `Special handler that's fired when the user uploads a file to your bot (by default supports json/csv/txt.) If you use the word "convert", it will convert a spreadsheet (.xlsx) file to an html preview`,},];exportdefaulthandlers;
I want the user to be able to enter a file and write some code to process it, is that possible?
The text was updated successfully, but these errors were encountered: