Advertisement
3morryyyyy

Untitled

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