Facebook
From £lræn, 3 Years ago, written in JavaScript.
This paste is a reply to Untitled from AraShi - view diff
Embed
Download Paste or View Raw
Hits: 181
  1. const Discord = require("discord.js");
  2. const shorten = require("vgd");
  3.  
  4. exports.run = (client, message, args) => {
  5. if (!args[1]) {
  6.             shorten.shorten(args[0], (res) => {
  7.                 if (res.startsWith("Hata:")) {
  8.                     return message.channel.send("**Kısaltılacak link belirtilmedi**");
  9.                 }
  10.                 message.channel.send(`<${res}>`);
  11.             });
  12.         } else if (args[1]) {
  13.             shorten.custom(args[0], args[1], (res) => {
  14.                 if (res.startsWith("Hata:")) {
  15.                     return message.channel.send(`${res}`);
  16.                 }
  17.                 message.channel.send(`<${res}>`);
  18.             });
  19.         } else {
  20.             return message.reply("Üzgünüm linki kısaltamadım");
  21.         }
  22.     }
  23.  
  24.  
  25. module.exports.conf = {
  26.   enabled: true,
  27.   guildOnly: false,
  28.   aliases: [],
  29.   permLevel: 0
  30. };
  31.  
  32. module.exports.help = {
  33.   name: 'kısalt',
  34.   description: '',
  35.   usage: 'kısalt <url>'
  36. };
  37.