Advertisement
Guest User

كود الساعة by maffia

a guest
Mar 20th, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. var prefix = "f!";
  2. client.on('message', message => {
  3. if (message.content === prefix + "dt") {
  4. if (!message.channel.guild) return message.reply('** This command only for servers **');
  5. var currentTime = new Date(),
  6. hours = currentTime.getHours() + 4 ,
  7. hours2 = currentTime.getHours() + 3 ,
  8. hours3 = currentTime.getHours() + 2 ,
  9. hours4 = currentTime.getHours() + 3 ,
  10. minutes = currentTime.getMinutes(),
  11. seconds = currentTime.getSeconds(),
  12. Year = currentTime.getFullYear(),
  13. Month = currentTime.getMonth() + 1,
  14. Day = currentTime.getDate();
  15. var h = hours
  16. if(hours > 12) {
  17. hours -= 12;
  18. } else if(hours == 0) {
  19. hours = "12";
  20. }
  21. if(hours2 > 12) {
  22. hours2 -= 12;
  23. } else if(hours2 == 0) {
  24. hours2 = "12";
  25.  
  26. }
  27. if(hours3 > 12) {
  28. hours3 -= 12;
  29. } else if(hours3 == 0) {
  30. hours3 = "12";
  31. }
  32. if (minutes < 10) {
  33. minutes = '0' + minutes;
  34. }
  35. var suffix = 'صباحاَ';
  36. if (hours >= 12) {
  37. suffix = 'مساء';
  38. hours = hours - 12;
  39. }
  40. if (hours == 0) {
  41. hours = 12;
  42. }
  43.  
  44.  
  45. var Date15= new Discord.RichEmbed()
  46. .setThumbnail("https://i.imgur.com/ib3n4Hq.png")
  47. .setTitle( "『التاريخ والوقت』")
  48. .setColor('RANDOM')
  49. .setFooter(message.author.username, message.author.avatarURL)
  50. .addField('الامارات',
  51. "『"+ hours + ":" + minutes +":"+ seconds + "』")
  52. .addField('مكه المكرمه',
  53. "『"+ hours2 + ":" + minutes +":"+ seconds + "』")
  54. .addField('مصر',
  55. "『"+ hours3 + ":" + minutes +":"+ seconds + "』")
  56.  
  57. .addField('Date',
  58. "『"+ Day + "-" + Month + "-" + Year + "』")
  59.  
  60. message.channel.sendEmbed(Date15);
  61. }
  62. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement