Skip to content

Commit

Permalink
Screw it. I rewrote it.
Browse files Browse the repository at this point in the history
Rewrote brought better styling, a nicer class system for the developer. Oh did i mention i removed the shitty api? Might add that back but it will work then. Removed useless files such as *.bat's. README looks nice. main file isn't a clusterfuck... uh oh i removed some other cancerous files. Yea the app needed this.
  • Loading branch information
Aervyon committed Jun 22, 2019
1 parent 2ef2ebb commit 6cc9a3e
Show file tree
Hide file tree
Showing 13 changed files with 307 additions and 641 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Ignore config(s)

config.json
config.js

# Ignore node modules

node_modules/

# Ignore lock files

yarn.lock
package-lock.json
95 changes: 32 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,82 +1,51 @@
# jsLiam
# jsLiam 2.0

A simple rich presence i made for the people of the dyno server. Repurpose it if you wish.
jsLiam is a discord rich presence application that is very lightweight.

I built this rich presence app to be customizable and lightweight at the same time, by making it so you can just use the terminal and notepad to edit it

- Name and release format thought of by `Mika K.`
jsLiam 2.0 is handled by its own special client that works as a compatability layer between discord-rpc and the developer.

## Required things
# Config

- NodeJS 8.0.0+
- A text editor that can handle JSON files (if you want to set it up differently), notepad will work just fine.
- Terminal access
You can use either js or json for configs now. Yay!

## Getting started
**If it is in <code>[]</code> it is optional**

- First install all dependencies (one) by running `npm install` (in the applications directory) in the terminal or by running the `install.bat` file (windows)
| Param | Type(s) | Description

- Then check if it works by doing `npm start` (in the applications directory) in the terminal or by running the `start.bat` file (windows)
[config.largeImageKey] | <code>Array</code> | <code>String</code> | The presence largeImageKey
[config.largeImageText] | <code>Array</code> | <code>String</code> | The presence largeImageText
[config.lsmallImageKey] | <code>Array</code> | <code>String</code> | The presence smallImageKey
[config.smallImageText] | <code>Array</code> | <code>String</code> | The presence smallImageText
[config.state] | <code>Array</code> | <code>String</code> | The presences state.
[config.details] | <code>Array</code> | <code>String</code> | The presence details
[config.timestamp] | <code>Boolean</code> | <code>String</code> | <code>False</code> | Whether or not to have a timestamp. "now" will reset the timestamp.
[config.partySize] | <code>Number</code> | The party size. Max: 1000.
[config.partyMax] | <code>Number</code> | The maximum party size. Max: 100
[config.noUpdate] <code>Boolean</code> | Whether or not to update the config.
config.clientId | <code>String</code> | The client ID for the app you will be using with the presence.

- You can configure it by using a file named `config.json` in the root of the application.
# How strict is jsLiam?

## A warning for if you use pm2
This new version is fairly strict compared to the old one. You can take a look at most of the code in [src/structures/PresenceClient.js](./src/structures/PresenceClient.js).

Know what pm2 does, and how to use it if you want to use pm2. If you are using pm2 you should know how to reload the application, start the application, stop the application, and view the logs for the application
# Example configs

## Features
You can view a JS and a JSON example config under [example.config.json](./example.config.json) (json) or [example.config.js](./example.config.js) (JS)

- A hot reloadable configuration file. If you want to reload the configuration file, just type `refresh` into your terminal (unless of course you are using pm2)
# Setup

- Easy configuration. The configuration keys are below, and are easy to understand (most of the time).
Requiremennts

- Everything is able to be disabled.
- Nodejs (8+)
- NPM/YARN
- Discord
- Internet access

## Configuration keys
# Notes

`clientId` - (optional) The clientId of the discord developers application you want to use (Can be changed once app is running by saying `refreshclient` to the terminal)
jsLiam NO LONGER comes pre setup. You have to build your own app. Kthx bai. Might change my mind on this.

`staticQuote` - (optional) Makes the quote static, but the quote needs to be a string. If the quote is not a string, it will error out. Allowed values: `'true'` - Makes the quote static. Example: `"staticQuote": "true"`
# Copyright

`timestamp` - (optional) Whether or not you want a beginning timestamp. Allowed values: `true`, or `"true"` - Makes sure the timestamp is on. `"now"` - Resets the timestamp to the current date when you refresh, rewrites your config and makes a backup called "oldConfig.json" Default: `true`

`defaultQuotes` - (optional) Whether or not you want the default quotes on. Allowed values: `'false'` - Disables the default quotes. Default: `true`

`quotes` - (optional) Additional quotes (unless `defaultQuotes` is `'false'`). Can be a single quote if `"staticQuote"` is `'true'` Example: `[ "Making a personal bot", "Making a private bot" ]`, `"Making a bot"`

`largeImageKey` - (optional) The large image of the presence. Example: `"largeImageKey": "code"`, `"largeImageKey": "[ "code", "bot" ]"`, `"largeImageKey": "disable"`. Default: `"jsLiam"`

`largeImageText` - (optional) The large images text. Example: `"largeImageText": "Coding a bot with eris (library)"`. Default: `null`/Does not exist

`smallImageKey` - (optional) The small image of the presence. Will not work if no large image! Example: `"smallImageKey": "js"`, `"smallImageKey": "[ "js", "vsc" ]"`. Default: `null`/Does not exist

`smallImageText` - (optional) The small images text. Example: `"smallImageText": "JavaScript"`. Default: `null`/Does not exist

`state` - (optional) A static state, must be a string. Example: `"state": "Step"`. Default: `null`/Does not exist

`maxPartySize` - (optional) The max party size (idk what you would use it for). Needs to be a **string** **Cannot be more then 100**. Requires: `state`. Example: `"maxPartySize": "3"`

`partySize` - (optional) The current party size. Needs to be a **string**. **Cannot be more then maxPartySize, or 100!** Requires: `state`, `maxPartySize`. Example: `"partySize": "1"`

## Want to get rid of the small or large image?

- To disable the largeImageKey you have to do `"largeImageKey": "disable"`.

- To disable to the smallImageKey, you just delete `"smallImageKey"`

### There is a example configuration file called `example.config.json`.

If you are going to set something as `false`, `undefined`, `0`, or `null`, just remove the key. It is useless then anyways.

- There is `altExample.config.json` to show a example of a alternate configuration

## If you want your own application that you control

- Go to [the Discord Developer Dashboard](https://discordapp.com/developers/applications/me)
- Create a new application
- Add some art assets under `Rich Presence` > `Art Assets` (you can have 150, and they must be atleast 512x512)
- Get the applications clientId
- Enter it (the clientID) into the config.json file
- Go ham with customization

Notice! Your application name will be your rich presence's name!
Copyright VoidNulll 2018-2019
11 changes: 0 additions & 11 deletions altExample.config.json

This file was deleted.

13 changes: 0 additions & 13 deletions assets.txt

This file was deleted.

6 changes: 6 additions & 0 deletions example.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
clientId: 'client ID Here',
timestamp: true,
state: 'JS master race',
largeImageKey: 'null',
};
12 changes: 6 additions & 6 deletions example.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"clientId": "513462902053797903",
"timestamp": "false",
"quotes": [ "Posting random stuff", "Pong!" ],
"largeImageKey": "dynoglitch",
"largeImageText": "Dyno server icon",
"state": "Ping!"
"clientId": "Client ID here",
"timestamp": true,
"state": "I am Null",
"details": ["Easy rewrite", "Weee", "Fuck Circular objects"],
"largeImageKey": "null",
"largeImageText": "Whats this?"
}
1 change: 0 additions & 1 deletion install.bat

This file was deleted.

Loading

1 comment on commit 6cc9a3e

@Aervyon
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i know.. forcing updates is bad...
I don't care, it needed to be forced and i really do not care about what it was like before.

  • Null

Please sign in to comment.