Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/harvle/discordprotocolurls
Build all of Discord's known protocol URLs easily
https://github.com/harvle/discordprotocolurls
discord discord-bot discord-js discord-protocol
Last synced: about 2 months ago
JSON representation
Build all of Discord's known protocol URLs easily
- Host: GitHub
- URL: https://github.com/harvle/discordprotocolurls
- Owner: Harvle
- License: apache-2.0
- Created: 2022-12-08T08:48:13.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-22T13:30:57.000Z (almost 2 years ago)
- Last Synced: 2024-12-21T14:22:41.359Z (about 2 months ago)
- Topics: discord, discord-bot, discord-js, discord-protocol
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/discordprotocolurls
- Size: 13.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DiscordProtocolURLs
> **DISCLAIMER:** Discord does not officially support or document their protocol URLs.
This package allows you to easily build Discord's protocol URLs, and optionally format them to be clickable links in Discord.
## Install:
```
npm install discordprotocolurls
```## Documentation:
https://github.com/Harvle/DiscordProtocolURLs/wiki/Documentation## Missing Links:
Create an issue or a pull request with the link that is missing and it'll be implemented into the library. All the links that are in the library are from [this Gist](https://gist.github.com/ghostrider-05/8f1a0bfc27c7c4509b4ea4e8ce718af0), so all credit goes to the gist's creator and the comments on the gist for locating these links.## Example Usages (TypeScript / ES):
```ts
// Standalone
import ProtocolURLBuilder from "discordprotocolurls";const protocolURLs = new ProtocolURLBuilder();
console.log(protocolURLs.guild("1234567891011121314"));
// Output: "discord://-/channels/1234567891011121314"
```
```ts
// Extending Discord.JS Client
import { Client } from "discord.js";
import ProtocolURLBuilder from "discordprotocolurls";class ExtendedClient extends Client {
protocolURLs: ProtocolURLBuilder; // TypeScript only
constructor(options) {
this.protocolURLs = new ProtocolURLBuilder();
};
};const client = new ExtendedClient();
console.log(client.protocolURLs.guild("1234567891011121314"));
// Output: "discord://-/channels/1234567891011121314"
```## Example Usages (CommonJS):
```js
// Standalone
const ProtocolURLBuilder = require("discordprotocolurls");const protocolURLs = new ProtocolURLBuilder();
console.log(protocolURLs.guild("1234567891011121314"));
// Output: "discord://-/channels/1234567891011121314"
```
```js
// Extending Discord.JS Client
const { Client } = require("discord.js");
const ProtocolURLBuilder = require("discordprotocolurls");class ExtendedClient extends Client {
constructor(options) {
this.protocolURLs = new ProtocolURLBuilder();
};
};const client = new ExtendedClient();
console.log(client.protocolURLs.guild("1234567891011121314"));
// Output: "discord://-/channels/1234567891011121314"
```