Advertisement
TypicalOperator

Breeze RPC (rpc.js)

May 31st, 2025 (edited)
87
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // breeze rpc v4hbbq80n46e067b9s5n7s345n64
  2. // what happen:
  3. // remove useless things
  4. // uhh idk
  5.  
  6. const RPC = require("discord-rpc");
  7. const express = require("express");
  8. const app = express();
  9.  
  10. const clientId = "1378470267352912004"; // change if u want
  11. RPC.register(clientId);
  12.  
  13. const rpc = new RPC.Client({
  14.     transport: "ipc"
  15. });
  16.  
  17. var currentState = "Idle";
  18. var rpcPaused = false;
  19.  
  20. app.get("/rpc/set", async (req, res) => {
  21.     const {
  22.         state,
  23.         username,
  24.         brand
  25.     } = req.query;
  26.  
  27.     console.log(state, username, brand);
  28.  
  29.     if (!username) return res.status(400).send("Username is required.");
  30.  
  31.     // removed cuz it was there for another removed thing
  32.     if (state) currentState = state;
  33.  
  34.     if (brand === "stop") {
  35.         rpc.clearActivity();
  36.         rpcPaused = true;
  37.         return res.send("RPC paused.");
  38.     }
  39.  
  40.     /*if (brand !== "Vanilla" && brand !== "Lunar Client") {
  41.         return res.status(400).send("invalid brand. you need to create your own discord app if you want a different brand");
  42.     }*/ // disabled cuz user will not even be able to see
  43.  
  44.     rpcPaused = false;
  45.     rpc.setActivity({
  46.         state: currentState,
  47.         details: `Playing Minecraft 1.8.9 as ${username}`,
  48.         startTimestamp: new Date(),
  49.         largeImageKey: "breeze_logo",
  50.         largeImageText: "Breeze Logo",
  51.         smallImageKey: brand === "Lunar Client" ? "lunarclient" : "vanilla",
  52.         smallImageText: brand,
  53.         instance: false,
  54.     });
  55.  
  56.     return res.sendFile('.\\breeze.png');
  57. });
  58.  
  59. rpc.on("ready", () => {
  60.     if (!rpcPaused) {
  61.         rpc.setActivity({
  62.             state: currentState,
  63.             details: `Minecraft 1.8.9`,
  64.             startTimestamp: new Date(),
  65.             largeImageKey: "breeze_logo",
  66.             largeImageText: "Breeze Logo",
  67.             smallImageKey: "vanilla",
  68.             smallImageText: `Vanilla`,
  69.             instance: false,
  70.         });
  71.     }
  72.  
  73.     console.log("Discord Rich Presence is ready.");
  74. });
  75.  
  76. rpc.login({
  77.     clientId
  78. }).catch(console.error);
  79.  
  80. app.listen(7532, () => {
  81.     console.log("breeze rpc script running localhost:7532");
  82. });
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement