Skip to content

Commit

Permalink
feat: updated examples
Browse files Browse the repository at this point in the history
  • Loading branch information
xhayper committed Aug 17, 2022
1 parent 2cf4925 commit b14eef1
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 65 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
## Example

```ts
import { Client } from "@xhayper/discord-rpc";
import { Client } from "https://raw.githubusercontent.com/xhayper/discord-rpc-deno/main/src/mod.ts";

const client = new Client({
clientId: "123456789012345678"
Expand Down
46 changes: 23 additions & 23 deletions examples/simple_oauth.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
const { Client } = require("@xhayper/discord-rpc");
import { Client } from "https://raw.githubusercontent.com/xhayper/discord-rpc-deno/main/src/mod.ts";

const client = new Client({
clientId: "123456789012345678",
clientSecret: "YOUR_CLIENT_SECRET"
clientId: "123456789012345678",
clientSecret: "YOUR_CLIENT_SECRET",
});

client.on("ready", async () => {
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl"
});
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl",
});
});

client.login({
scopes: [
"connections",
"email",
"identify",
"guilds",
"guilds.join",
"guilds.members.read",
"gdm.join",
"messages.read",
"rpc",
"rpc.notifications.read"
],
prompt: "none" // Only prompt once
scopes: [
"connections",
"email",
"identify",
"guilds",
"guilds.join",
"guilds.members.read",
"gdm.join",
"messages.read",
"rpc",
"rpc.notifications.read",
],
prompt: "none", // Only prompt once
}); // These are the allowed scopes for unapproved app.
46 changes: 23 additions & 23 deletions examples/simple_oauth.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
import { Client } from "@xhayper/discord-rpc";
import { Client } from "https://raw.githubusercontent.com/xhayper/discord-rpc-deno/main/src/mod.ts";

const client = new Client({
clientId: "123456789012345678",
clientSecret: "YOUR_CLIENT_SECRET"
clientId: "123456789012345678",
clientSecret: "YOUR_CLIENT_SECRET",
});

client.on("ready", async () => {
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl"
});
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl",
});
});

client.login({
scopes: [
"connections",
"email",
"identify",
"guilds",
"guilds.join",
"guilds.members.read",
"gdm.join",
"messages.read",
"rpc",
"rpc.notifications.read"
],
prompt: "none" // Only prompt once
scopes: [
"connections",
"email",
"identify",
"guilds",
"guilds.join",
"guilds.members.read",
"gdm.join",
"messages.read",
"rpc",
"rpc.notifications.read",
],
prompt: "none", // Only prompt once
}); // These are the allowed scopes for unapproved app.
18 changes: 9 additions & 9 deletions examples/simple_status.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
const { Client } = require("@xhayper/discord-rpc");
import { Client } from "https://raw.githubusercontent.com/xhayper/discord-rpc-deno/main/src/mod.ts";

const client = new Client({
clientId: "123456789012345678"
clientId: "123456789012345678",
});

client.on("ready", async () => {
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl"
});
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl",
});
});

client.login();
18 changes: 9 additions & 9 deletions examples/simple_status.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { Client } from "@xhayper/discord-rpc";
import { Client } from "https://raw.githubusercontent.com/xhayper/discord-rpc-deno/main/src/mod.ts";

const client = new Client({
clientId: "123456789012345678"
clientId: "123456789012345678",
});

client.on("ready", async () => {
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl"
});
await client.user?.setActivity({
state: "Suffering with my life",
details: "Pain and Suffering",
startTimestamp: Date.now(),
largeImageKey: "main",
largeImageText: "me irl",
});
});

client.login();

0 comments on commit b14eef1

Please sign in to comment.