Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // breeze rpc v4hbbq80n46e067b9s5n7s345n64
- // what happen:
- // remove useless things
- // uhh idk
- const RPC = require("discord-rpc");
- const express = require("express");
- const app = express();
- const clientId = "1378470267352912004"; // change if u want
- RPC.register(clientId);
- const rpc = new RPC.Client({
- transport: "ipc"
- });
- var currentState = "Idle";
- var rpcPaused = false;
- app.get("/rpc/set", async (req, res) => {
- const {
- state,
- username,
- brand
- } = req.query;
- console.log(state, username, brand);
- if (!username) return res.status(400).send("Username is required.");
- // removed cuz it was there for another removed thing
- if (state) currentState = state;
- if (brand === "stop") {
- rpc.clearActivity();
- rpcPaused = true;
- return res.send("RPC paused.");
- }
- /*if (brand !== "Vanilla" && brand !== "Lunar Client") {
- return res.status(400).send("invalid brand. you need to create your own discord app if you want a different brand");
- }*/ // disabled cuz user will not even be able to see
- rpcPaused = false;
- rpc.setActivity({
- state: currentState,
- details: `Playing Minecraft 1.8.9 as ${username}`,
- startTimestamp: new Date(),
- largeImageKey: "breeze_logo",
- largeImageText: "Breeze Logo",
- smallImageKey: brand === "Lunar Client" ? "lunarclient" : "vanilla",
- smallImageText: brand,
- instance: false,
- });
- return res.sendFile('.\\breeze.png');
- });
- rpc.on("ready", () => {
- if (!rpcPaused) {
- rpc.setActivity({
- state: currentState,
- details: `Minecraft 1.8.9`,
- startTimestamp: new Date(),
- largeImageKey: "breeze_logo",
- largeImageText: "Breeze Logo",
- smallImageKey: "vanilla",
- smallImageText: `Vanilla`,
- instance: false,
- });
- }
- console.log("Discord Rich Presence is ready.");
- });
- rpc.login({
- clientId
- }).catch(console.error);
- app.listen(7532, () => {
- console.log("breeze rpc script running localhost:7532");
- });
Advertisement
Comments
-
- bitcoin booster bc1qpukq4ufv43z47dv0x5xm7g85cy30xjlfz2626n
Add Comment
Please, Sign In to add comment
Advertisement