gaber-elsayed

Untitled

Jul 24th, 2021
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.14 KB | None | 0 0
  1. const Discord = require("discord.js");
  2. const client = new Discord.Client();
  3. require('discord-reply');
  4. const Dataa = require('st.db');
  5. const db = new Dataa(`/Datas/reports-data.json`);
  6. const randomstring = require("randomstring");
  7. const config = require(`./config.json`)
  8. const app = require('express')();
  9. app.get('/', (req, res) => res.send('shuruhatik.xyz'));
  10. app.listen(3000)
  11. const disbut = require('discord-buttons');
  12. disbut(client);
  13.  
  14. ///All Copy Right Reserved For: Shuruhatik in YT
  15. client.on("messageReactionAdd", async (reaction, user) => {
  16. if(config.only == true){
  17. if(reaction.message.channel.id != config.onlyChannel) return;
  18. }
  19. let message = reaction.message, emoji = reaction.emoji;
  20. if (emoji.name == config.emoji_1 || emoji.name == config.emoji_2) {
  21. reaction.remove(user);
  22. let embed = new Discord.MessageEmbed()
  23. .setDescription(`Do you want to follow up and submit the **report**?\nهل تريد المتابعة وتقديم **الأبلاغ**؟`)
  24. .setColor('#5865F2')
  25. let accept_embed = new Discord.MessageEmbed()///All Copy Right Reserved For: Shuruhatik in YT
  26. .setColor("#5865F2")
  27. .setTitle("Information about reporting")
  28. .addField(`Reported user`, reaction.message.author.username,true)
  29. .addField(`Report by`, user.username,true)
  30. .addField(`Message`, `\`\`\`${reaction.message.content}\`\`\``)
  31. .addField(`Message Link`,`[click here](https://discord.com/channels/${reaction.message.channel.guild.id}/${reaction.message.channel.id}/${reaction.message.id})`,true)
  32. .addField(`Channel`,`<#${reaction.message.channel.id}>`,true)
  33. .setFooter(reaction.message.channel.guild.name)
  34. .setTimestamp()
  35. let id = randomstring.generate({ length: 20 })
  36. let did = randomstring.generate({ length: 20 })
  37.  
  38. let button = new disbut.MessageButton()///All Copy Right Reserved For: Shuruhatik in YT
  39. .setStyle(`gray`)
  40. .setEmoji("✅")
  41. .setID(id)
  42. let d_button = new disbut.MessageButton()///All Copy Right Reserved For: Shuruhatik in YT
  43. .setStyle(`gray`)
  44. .setEmoji("❌")
  45. .setID(did)
  46. let msg = await user.send({
  47. embed: embed, buttons: [
  48. button, d_button
  49. ]
  50. })
  51. client.on('clickButton', async (button) => {
  52. if (button.id == did) {
  53. await button.reply.send(`✅ Report canceled **successfully**`, true)///All Copy Right Reserved For: Shuruhatik in YT
  54. msg.delete()
  55. }
  56. if (button.id == id) {
  57. await db.set(`report_${id}`, {
  58. reported_user: reaction.message.author.id,
  59. message: reaction.message.content,
  60. report_by: user.id,
  61. created_at: new Date(),
  62. messageID: reaction.message.id,
  63. channelID: reaction.message.channel.id,
  64. guildID: reaction.message.channel.guild.id,
  65. })
  66. msg.edit({embed:accept_embed})
  67. await button.reply.send(`🙂 Thank you for your **report**!\n\n> [Go to the message on which the report was submitted](https://discord.com/channels/${reaction.message.channel.guild.id}/${reaction.message.channel.id}/${reaction.message.id})`, true);
  68. client.channels.cache.get(config.logchannel).send({ embed: accept_embed }).catch(err => console.log(`channel log error`))///All Copy Right Reserved For: Shuruhatik in YT
  69. }
  70. })
  71. }
  72. });
  73.  
  74. client.on("ready", async () => {
  75. await client.user.setActivity(config.status || `Bot Created by Shuruhatik.yxz`)
  76. console.clear()
  77. console.log(`\u001b[38;5;220m------- ﺩﺭﻮﻜﺴﻳﺪﻠﻟ ﻞﺋﺎﺳﺭ ﻦﻋ ﻍﻼﺑﻹﺍ ﻡﺎﻈﻧ ﺕﻮﺑ -------\n\u001b[38;5;220m> \x1b[32mﺭﺍﺪﺻﺇ: \x1b[37m1.0\n\u001b[38;5;220m> \x1b[32mﺕﻮﺒﻟﺍ ﺔﻟﺎﺣ: \x1b[37m\x1b[7mﻞﺼﺘﻣ\x1b[0m\n\u001b[38;5;220m------- ﺩﺭﻮﻜﺴﻳﺪﻠﻟ ﻞﺋﺎﺳﺭ ﻦﻋ ﻍﻼﺑﻹﺍ ﻡﺎﻈﻧ ﺕﻮﺑ -------\x1b[37m\n\x1b[44mﺮﺸﻨﻟﺍﻭ ﻒﻴﻟﺄﺘﻟﺍ ﻕﻮﻘﺣ:\x1b[0m \x1b[4mﻰﻟﺇ ﺮﺸﻨﻟﺍ ﻕﻮﻘﺣ ﻊﻴﻤﺟ https://www.shuruhatik.xyz/\x1b[0m \u001b[0m`);
  78. })
  79.  
  80. ///All Copy Right Reserved For: Shuruhatik in YT
  81. client.login(process.env['token']);
Advertisement
Add Comment
Please, Sign In to add comment