Skip to content
This repository has been archived by the owner on Apr 23, 2022. It is now read-only.

Latest commit

 

History

History
42 lines (33 loc) · 1.3 KB

WEBUSE.md

File metadata and controls

42 lines (33 loc) · 1.3 KB

Tnai API

{% hint style="sucess" %} The "https://tnai.ml" website can now be used!. {% endhint %}

downloads version

A simple endpoint that you can use for Discord.js or other apps, follow reading so you can discover how to use our endpoints.

Some dependencies that you can use: Snekfetch | Node-fetch

Using with Snekfetch:

Here you will get the SFW category URL:

const request = require('snekfetch');
    request.get('https://tnai.ml/api/image?type=hug', {
    headers: {
    "Authorization": "YOUR_TOKEN"
    }
    }).then(response => { 
    console.log(response.body.url)
});```

### Sending from a MessageAttachment
This method is not compatible with Discord.js v11 version.

```js
const { MessageEmbed, MessageAttachment } = require('discord.js');
    const request = require('snekfetch');
    request.get('https://tnai.ml/api/image?type=hug', {
    headers: {
    "Authorization": "YOUR_TOKEN"
    }
    }).then(response => {
    const attachment = response.body.url;
     message.channel.send([attachment]);
    });