Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miatoszs/discord-torrent
npm distord torrent module
https://github.com/miatoszs/discord-torrent
1337x discord discord-bot discord-js nodejs torrent
Last synced: about 1 month ago
JSON representation
npm distord torrent module
- Host: GitHub
- URL: https://github.com/miatoszs/discord-torrent
- Owner: miatoszs
- License: gpl-3.0
- Created: 2022-12-11T18:49:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-12T18:54:51.000Z (about 2 years ago)
- Last Synced: 2024-11-16T15:09:10.520Z (about 2 months ago)
- Topics: 1337x, discord, discord-bot, discord-js, nodejs, torrent
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/discord-torrent?activeTab=readme
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
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 ",
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)