const Discord = require("discord.js");
const ayarlar = require("../ayarlar.json")
const https = require("https");
  

exports.run = async (client, message, args) => {
 const input = args.join(" ");
  if (!input) return message.reply("Lütfen bi yazı giriniz.");

  const apiId = "40694682-95fa-44bc-9d3c-5135d7cc3c9d";
  const apiKey = "a0a6ec04-8c7f-4cf9-89e3-258bca9bec5f";

  const data = JSON.stringify({
    html: input
  });

  const options = {
    hostname: "hcti.io",
    port: 443,
    path: "/v1/image",
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      Authorization:
        "Basic " + new Buffer(apiId + ":" + apiKey).toString("base64")
    }
  };
  const req = https.request(options, res => {

    res.on("data", d => {
      const image = JSON.parse(d);
      const em = new Discord.RichEmbed()
        .setAuthor("Render:")
        .setImage(image["url"])
        .setColor("#36393F");
      message.channel.send(em);
    });
  });

  req.on("error", error => {
    console.error(error);
    return message.channel.send(error.message);
  });

  req.write(data);
  req.end();
}

exports.conf = {
  enabled: true,
  guildOnly: false,
  aliases: ["yazıresim","yazıimage","textimage","yaziresim"],
  permLevel: 0
};

exports.help = {
  name: 'yazırender',
  description: 'TesT Komutudur',
  usage: &#039;yazırender <yazı>&#039;
};
//XiR

Add a code snippet to your website: www.paste.org