# discord-torrent

> # Example usage ```js const Discord = require("discord.js"); const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');

Latest version **1.0.7** (published 2022-12-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install discord-torrent
pnpm add discord-torrent
yarn add discord-torrent
bun add discord-torrent
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-12-13 |
| First published | 2022-12-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | .Áldó#6194 |
| Maintainers | aldo-torrent-bot |

## Links

- npm: https://www.npmjs.com/package/discord-torrent
- Repository: https://github.com/miatoszs/discord-torrent
- Homepage: https://github.com/miatoszs/discord-torrent#readme
- Issues: https://github.com/miatoszs/discord-torrent/issues
- npm.io page: https://npm.io/package/discord-torrent

## Dependencies (3)

- [urlencode](https://npm.io/package/urlencode.md) ^1.1.0
- [node-fetch](https://npm.io/package/node-fetch.md) ^3.3.0
- [torrent-search-api](https://npm.io/package/torrent-search-api.md) ^2.1.4

## Recent versions

- 1.0.7 (latest) — 2022-12-13
- 1.0.6 — 2022-12-13
- 1.0.5 — 2022-12-13
- 1.0.4 — 2022-12-11
- 1.0.3 — 2022-12-11
- 1.0.2 — 2022-12-11
- 1.0.1 — 2022-12-11
- 1.0.0 — 2022-12-11

## README

# Discord-torrent

# Example usage
```js
const Discord = require("discord.js");
const { EmbedBuilder, ActionRowBuilder, ButtonBuilder } = require('discord.js');

const torrent_module = require('discord-torrent')
const torrent = require('discord-torrent')

module.exports = {
    name: "torrent",
    aliases: ['1337x'],
    description: "search torrent",
    usage: ".torrent <torrent name>",
    run: async (client, message, args) => {
    if(!args.length) {
        return message.channel.send("What do you want to download?")
          }


      message.channel.send({ content: "`Searching...`" })
      let query = "";
      args.map(string=> {
          query += " " + string;
      });
      torrent_module.grabTorrents(query)
      .then(torrentArray => {

          if (torrentArray.length > 0)
          {

              const torrentList = new EmbedBuilder()
              torrentArray.map((torrent) => {
                torrentList.addFields(
                    { name : `${torrent.number}. ${torrent.title}`, value : `${torrent.magnet} | Seeders: ${torrent.seeds} | Size: ${torrent.size} | Time: ${torrent.time}`}
                )
            });
            message.reply({ embeds: [torrentList] }); //Send them the list of torrents in the channel


          }
          else
          {
              
            const error = new EmbedBuilder()
            .setTitle("Not found")
            .addFields({ name: 'Message', value: 'Torrent not found!.', inline: true })
            .setTimestamp()
            message.reply({ embeds: [error] });
              
          }

      });
   
  }}
  ```
![enter image description here](https://cdn.discordapp.com/attachments/718452489342550037/1051576294573359215/Screenshot_from_2022-12-11_20-08-29.png)
# Invite:
<p align="center">
 <a href="https://discord.com/api/oauth2/authorize?client_id=780882185896591360&permissions=8&scope=bot">
    <img alt="bot" src="https://cdn.discordapp.com/attachments/718452489342550037/1051838923120320512/Screenshot_from_2022-12-12_13-31-37.png"></a>
</p>

---
_Source: https://npm.io/package/discord-torrent · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
