Advertisement
Guest User

item drop v2 item notification for my discord bot

a guest
Apr 7th, 2020
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var InformIfNewItem = function() {
  2.   let Response = axios.get(getreq);
  3.   Response.then(function(result) {
  4.     oldarray = result.data;
  5.   });
  6.   for (let s of newarray) {
  7.     checkmodecycle(s);
  8.     const yourchannel = client.channels.find(
  9.       channel => channel.name === "bot-announcements"
  10.     );
  11.     const yourchannel2 = client.channels.find(
  12.       channel => channel.name === "general"
  13.     );
  14.  
  15.     if (finditemfromoldarray(s.Name) == false) {
  16.       if (mode == "newitem") {
  17.         if (yourchannel != null) {
  18.           yourchannel.send({
  19.             embed: {
  20.               color: 3447003,
  21.               author: {
  22.                 name: client.user.username,
  23.                 icon_url: client.user.avatarURL
  24.               },
  25.               title: "New item released: " + s.Name,
  26.               url: s.AbsoluteUrl,
  27.               description: s.Description,
  28.               fields: [
  29.                 {
  30.                   name: "Price",
  31.                   value: s.Price + " Robux"
  32.                 },
  33.                 {
  34.                   name: "IsLimited",
  35.                   value: s.IsLimited
  36.                 },
  37.                 {
  38.                   name: "Sales",
  39.                   value: s.Sales
  40.                 },
  41.                 {
  42.                   name: "Favorties",
  43.                   value: s.Favorited
  44.                 },
  45.                 {
  46.                   name: "Last Updated",
  47.                   value: s.Updated
  48.                 },
  49.                 {
  50.                   name: "Creator",
  51.                   value: s.Creator
  52.                 }
  53.               ],
  54.               timestamp: new Date(),
  55.               footer: {
  56.                 icon_url: client.user.avatarURL,
  57.                 text: "Roblox++ V" + BOTID
  58.               }
  59.             }
  60.           });
  61.         } else if (yourchannel2 != null) {
  62.           yourchannel2.send({
  63.             embed: {
  64.               color: 3447003,
  65.               author: {
  66.                 name: client.user.username,
  67.                 icon_url: client.user.avatarURL
  68.               },
  69.               title: "New item released: " + s.Name,
  70.               url: "https://www.roblox.com/catalog/" + s.AssetId,
  71.               description: s.Description,
  72.               fields: [
  73.                 {
  74.                   name: "Price",
  75.                   value: s.Price + "Robux"
  76.                 },
  77.                 {
  78.                   name: "IsLimited",
  79.                   value: s.IsLimited
  80.                 },
  81.                 {
  82.                   name: "Sales",
  83.                   value: s.Sales
  84.                 },
  85.                 {
  86.                   name: "Favorties",
  87.                   value: s.Favorited
  88.                 },
  89.                 {
  90.                   name: "Last Updated",
  91.                   value: s.Updated
  92.                 },
  93.                 {
  94.                   name: "Creator",
  95.                   value: s.Creator
  96.                 }
  97.               ],
  98.               timestamp: new Date(),
  99.               footer: {
  100.                 icon_url: client.user.avatarURL,
  101.                 text: "Roblox++ V" + BOTID
  102.               }
  103.             }
  104.           });
  105.         }
  106.       }
  107.     }
  108.   }
  109. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement