Facebook
From Erenay, 4 Months ago, written in JavaScript.
This paste is a reply to Untitled from Erenay - go back
Embed
Viewing differences between Untitled and Re: Untitled
\n    const {
      Discord,
      EmbedBuilder,
      SlashCommandBuilder,
      AttachmentBuilder
    
{ Discord, EmbedBuilder, SlashCommandBuilder, AttachmentBuilder } = require('discord.js')
    const {
      updatePingChart,
      canvas
    
{ uuid } = require('uuidv4');
const { updatePingChart, stream 
} = require("../helpers/chart");

    
/helpers/chart");
function wait(time) {
      
{
  
return new Promise(resolve => setTimeout(resolve, time));
    }
    
time));

const fs = require("fs")
    
require("fs")
module.exports = {
          slash: true,
      
true,                               
    
cooldown: 1200,

      
1200, 
  
    
data: new SlashCommandBuilder()
        .
SlashCommandBuilder()       
    .
setName('ping')
        .setDescription('Shows bot ping.'),\n\n          .setDescription('Botun gecikme sürelerini gösterir.'),
 
    
async execute(client, interaction) {

        
{
      
     
let pinge = ':Bot:'
        
'<:Bot:1065675104027148338>'
     
let bote = ':Ping:'
        
'<:Ping:1065675122683412481>'
     
let messageping mesajgecikme = new Date().getTime() - interaction.createdTimestamp
             let ping = await client.ws.ping
        \n             await updatePingChart(ping)
        
        const stream = canvas.createPNGStream();
        
updatePingChart(ping)
     
const attachment = new AttachmentBuilder(stream, {
          
name: 'ping.png'
        });
        
        
png' });
     
const embed = new EmbedBuilder()
          .
EmbedBuilder()
     .
addFields({
            name: `${bote}      name:`${bote} **Bot ping:**`,
            
gecikmesi:**`,
     
value: `\`${ping}ms\``
          }, {
            
``${ping}ms``
     },
     {
     
name: `${pinge} **Message ping:**`,
            
**Mesaj gecikmesi:**`,
     
value: `\`${messageping}ms\``
          })
          .
``${mesajgecikme}ms``})
     .
setColor(`Gold`)
          \n             await interaction.reply({
          embeds: [embed],
          attachments: [attachment]
        })
        
        wait(5000)
        
        
reply({embeds: [embed], files: [attachment]})
     wait(5000)
const fileName = 'pingChart.png';
        fs.unlinkSync(fileName);
      }
    }
unlinkSync(fileName);

  }
}