From 1e123de1e1bedb81a26cb918d310135c1f778621 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 18:05:46 +0100 Subject: [PATCH 1/9] Bump glob-parent from 6.0.0 to 6.0.1 (#29) Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 6.0.0 to 6.0.1. - [Release notes](https://github.com/gulpjs/glob-parent/releases) - [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md) - [Commits](https://github.com/gulpjs/glob-parent/compare/v6.0.0...v6.0.1) --- updated-dependencies: - dependency-name: glob-parent dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index ab91f22..8bda94f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -538,9 +538,9 @@ glob-parent@^5.1.2: is-glob "^4.0.1" glob-parent@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.0.tgz#f851b59b388e788f3a44d63fab50382b2859c33c" - integrity sha512-Hdd4287VEJcZXUwv1l8a+vXC1GjOQqXe+VS30w/ypihpcnu9M1n3xeYeJu5CBpeEQj2nAab2xxz28GuA3vp4Ww== + version "6.0.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.1.tgz#42054f685eb6a44e7a7d189a96efa40a54971aa7" + integrity sha512-kEVjS71mQazDBHKcsq4E9u/vUzaLcw1A8EtUeydawvIWQCJM0qQ08G1H7/XTjFUulla6XQiDOG6MXSaG0HDKog== dependencies: is-glob "^4.0.1" -- 2.45.2 From 1d26026b1a0f5547bf6d76d6f7f82f347d8ad0a2 Mon Sep 17 00:00:00 2001 From: Vylpes Date: Fri, 5 Aug 2022 15:24:55 +0100 Subject: [PATCH 2/9] Add .drone.yml (#32) Co-authored-by: Ethan Lane Reviewed-on: https://gitea.vylpes.xyz/Vylpes/random-bunny/pulls/32 --- .drone.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..14582fa --- /dev/null +++ b/.drone.yml @@ -0,0 +1,24 @@ +kind: pipeline +name: integration + +steps: + - name: build + image: node + commands: + - yarn install --frozen-lockfile + - name: test + image: node + commands: + - yarn test + depends_on: + - build + +trigger: + branch: + - develop + - feature/* + - hotfix/* + event: + - push + - pull_request + - tag \ No newline at end of file -- 2.45.2 From ee4f1873d1655f1ff90bb37811df66f70cfd8112 Mon Sep 17 00:00:00 2001 From: Vylpes Date: Fri, 12 Aug 2022 17:10:03 +0100 Subject: [PATCH 3/9] Fix type error (#34) Co-authored-by: Ethan Lane Reviewed-on: https://gitea.vylpes.xyz/RabbitLabs/random-bunny/pulls/34 --- .drone.yml | 4 +-- package.json | 3 ++- src/contracts/IFetchResult.ts | 15 ++++++++--- src/contracts/IReturnResult.ts | 6 +++++ src/index.ts | 49 +++++++++++++++++++--------------- tsconfig.json | 4 +-- yarn.lock | 5 ++++ 7 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 src/contracts/IReturnResult.ts diff --git a/.drone.yml b/.drone.yml index 14582fa..00b7c07 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,6 +19,4 @@ trigger: - feature/* - hotfix/* event: - - push - - pull_request - - tag \ No newline at end of file + - push \ No newline at end of file diff --git a/package.json b/package.json index cf11209..cb5021b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,8 @@ ], "dependencies": { "glob-parent": "^6.0.0", - "got": "^11.8.3" + "got": "^11.8.3", + "linqts": "^1.14.4" }, "scripts": { "build": "tsc", diff --git a/src/contracts/IFetchResult.ts b/src/contracts/IFetchResult.ts index e913b05..578bbea 100644 --- a/src/contracts/IFetchResult.ts +++ b/src/contracts/IFetchResult.ts @@ -1,6 +1,13 @@ -import IRedditResult from "./IRedditResult"; - export default interface IFetchResult { - IsSuccess: boolean; - Result?: IRedditResult; + data: { + archived: boolean, + downs: number, + hidden: boolean, + permalink: string, + subreddit: string, + subreddit_subscribers: number, + title: string, + ups: number, + url: string + } } \ No newline at end of file diff --git a/src/contracts/IReturnResult.ts b/src/contracts/IReturnResult.ts new file mode 100644 index 0000000..d0ba105 --- /dev/null +++ b/src/contracts/IReturnResult.ts @@ -0,0 +1,6 @@ +import IRedditResult from "./IRedditResult"; + +export default interface IReturnResult { + IsSuccess: boolean; + Result?: IRedditResult; +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index f61a93a..f9c6c6a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,8 @@ -import IFetchResult from "./contracts/IFetchResult"; +import IReturnResult from "./contracts/IReturnResult"; import IRedditResult from "./contracts/IRedditResult"; import fetch from "got"; +import { List } from 'linqts'; +import IFetchResult from "./contracts/IFetchResult"; const sortable = [ 'new', @@ -8,7 +10,7 @@ const sortable = [ 'top' ]; -export default async function randomBunny(subreddit: string, sortBy?: string, maxTries = 100): Promise { +export default async function randomBunny(subreddit: string, sortBy?: string, maxTries = 100): Promise { if (!sortBy || !sortable.includes(sortBy)) sortBy = 'hot'; const result = await fetch(`https://reddit.com/r/${subreddit}/${sortBy}.json`); @@ -27,32 +29,37 @@ export default async function randomBunny(subreddit: string, sortBy?: string, ma } } - const data = json.data.children; - const size = data.length; + const data: IFetchResult[] = json.data.children; + + const dataWithImages = new List(data) + .Where(x => x!.data.url.includes('.jpg') || x!.data.url.includes('.png')) + .ToArray(); for (let i = 0; i < maxTries; i++) { - const random = Math.floor((Math.random() * size - 1) + 0); // Between 0 and (size - 1) + const random = Math.floor((Math.random() * dataWithImages.length - 1) + 0); // Between 0 and (size - 1) - const randomSelect = data[random].data; + const randomSelect = dataWithImages[random]; + + if (!randomSelect) continue; + + const randomData = randomSelect.data; const redditResult: IRedditResult = { - Archived: randomSelect['archived'], - Downs: randomSelect['downs'], - Hidden: randomSelect['hidden'], - Permalink: randomSelect['permalink'], - Subreddit: randomSelect['subreddit'], - SubredditSubscribers: randomSelect['subreddit_subscribers'], - Title: randomSelect['title'], - Ups: randomSelect['ups'], - Url: randomSelect['url'] + Archived: randomData['archived'], + Downs: randomData['downs'], + Hidden: randomData['hidden'], + Permalink: randomData['permalink'], + Subreddit: randomData['subreddit'], + SubredditSubscribers: randomData['subreddit_subscribers'], + Title: randomData['title'], + Ups: randomData['ups'], + Url: randomData['url'] }; - if (redditResult.Url.includes('.jpg')) { - return { - IsSuccess: true, - Result: redditResult - }; - } + return { + IsSuccess: true, + Result: redditResult + }; } return { diff --git a/tsconfig.json b/tsconfig.json index f0e488f..26e2acf 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,7 +4,7 @@ /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ + "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */ // "lib": [], /* Specify library files to be included in the compilation. */ // "allowJs": true, /* Allow javascript files to be compiled. */ @@ -44,7 +44,7 @@ // "noPropertyAccessFromIndexSignature": true, /* Require undeclared properties from index signatures to use element accesses. */ /* Module Resolution Options */ - // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ diff --git a/yarn.lock b/yarn.lock index 8bda94f..990ec18 100644 --- a/yarn.lock +++ b/yarn.lock @@ -704,6 +704,11 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" +linqts@^1.14.4: + version "1.14.4" + resolved "https://registry.yarnpkg.com/linqts/-/linqts-1.14.4.tgz#0aa0f78fc6be073d7db874e0a0480fda5d06db7d" + integrity sha512-b5sJjG1ZQ8iLSTJV19jWgMLoQicrQVVRkkQN7B/aboU+cf30lgnhIoGM8vEjqPxZFpryDU78PFpuTnfYNIHMeg== + lodash.clonedeep@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" -- 2.45.2 From 57ab01c2cfa28324f7c975758c90713fbd2b4e49 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Thu, 18 Aug 2022 17:45:05 +0100 Subject: [PATCH 4/9] Update documentation with up to date information --- CODE_OF_CONDUCT.md | 2 +- CONTRIBUTING.md | 47 ++++++++++++++++++++++++++-------------------- package.json | 9 ++++++--- readme.md | 3 ++- 4 files changed, 36 insertions(+), 25 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index bf49b55..d4ae5d3 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -61,7 +61,7 @@ representative at an online or offline event. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at -[INSERT CONTACT METHOD]. +[helpdesk@vylpes.com](mailto:helpdesk@vylpes.com). All complaints will be reviewed and investigated promptly and fairly. All community leaders are obligated to respect the privacy and security of the diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5acd471..971bb3d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,6 +14,8 @@ This project and everyone participating in it is governed by the Random Bunny Co You can ask a question about the project in the `#development` channel in the [Discord Server](https://discord.gg/UyAhAVp). +You can also email with queries and support if you'd prefer at [helpdesk@vylpes.com](mailto:helpdesk@vylpes.com). + ## What you should know ### Javascript and Node @@ -115,13 +117,13 @@ You'll need the following tools: * Git * NodeJS +* Yarn Install and build all of the dependencies using `npm` ```bash -cd Random Bunny -npm install -cp config.json.template config.json +cd random-bunny +yarn install ``` And then use your text editor of choice to fill in the `config.json` file. @@ -132,22 +134,20 @@ If you want to understand how Random Bunny works or want to debug an issue, you' First, fork the Random Bunny repository so that you can make a pull request. Then, clone your fork locally: ```bash -git clone https://gitlab.vylpes.com//random-bunny.git +git clone https://gitea.vylpes.xyz//random-bunny.git ``` Occasionally, you will want to merge changes in the upstream repository (the official code repo) with your fork. ```bash -cd Random Bunny +cd random-bunny git checkout master -git pull https://gitlab.vylpes.com/vylpes/random-bunny.git master +git pull https://gitea.vylpes.xyz/vylpes/random-bunny.git master ``` Manage any merge conflicts, commit them, and then push them to your fork. -Go into `Random Bunny` and start the bot in dev mode with `npm run dev` or `node bot dev` - -> **Note:** If you have `nodemon` installed on your system you can use this during development so it auto restarts when you make code changes. Instead of the commands above you can then run `nodemon bot dev`. +Go into `random-bunny` and build the package using `yarn build`. #### Pull Requests @@ -169,6 +169,11 @@ Please follow these steps to have your contribution considered by maintainers: While the prerequesites above must be satisifed prior to having your pull reuqest accepted, the reviewer(s) may ask you to complete additional design ork, tests, or other changes before your pull request can be ultimately accepted. +#### Submitting Changes via Email +If you're not within our gitea instance and still like to contribute, you can send us your contributions to [git@vylpes.com](mailto:git@vylpes.com). + +For more information on how to do this, see the [git documentation](https://git-scm.com/docs/git-send-email). + #### JavaScript Styleguide All JavaScript code is linted with `eslint`. @@ -309,21 +314,20 @@ Unsure where to begin contributing to Random Bunny? You can start by looking thr #### Prerequisites -In order to download necessary tools, clone the repository, and install dependencies via `npm` you need network access. +In order to download necessary tools, clone the repository, and install dependencies via `yarn` you need network access. You'll need the following tools: * Git * NodeJS +* Yarn -Install and build all of the dependencies using `npm` +Install and build all of the dependencies using `yarn` ```bash -cd Random Bunny +cd random-bunny npm install -cp config.json.template config.json ``` -And then use your text editor of choice to fill in the `config.json` file. #### Build and Run @@ -332,22 +336,20 @@ If you want to understand how Random Bunny works or want to debug an issue, you' First, fork the Random Bunny repository so that you can make a pull request. Then, clone your fork locally: ```bash -git clone https://gitlab.vylpes.com//random-bunny.git +git clone https://gitea.vylpes.xyz//random-bunny.git ``` Occasionally, you will want to merge changes in the upstream repository (the official code repo) with your fork. ```bash -cd Random Bunny +cd random-bunny git checkout master -git pull https://github.com/getgravitysoft/random-bunny.git master +git pull https://gitea.vylpes.xyz/RabbitLabs/random-bunny.git master ``` Manage any merge conflicts, commit them, and then push them to your fork. -Go into `Random Bunny` and start the bot in dev mode with `npm run dev` or `node bot dev` - -> **Note:** If you have `nodemon` installed on your system you can use this during development so it auto restarts when you make code changes. Instead of the commands above you can then run `nodemon bot dev`. +Go into `random-bunny` and build the package using `yarn build`. #### Pull Requests @@ -369,6 +371,11 @@ Please follow these steps to have your contribution considered by maintainers: While the prerequesites above must be satisifed prior to having your pull reuqest accepted, the reviewer(s) may ask you to complete additional design ork, tests, or other changes before your pull request can be ultimately accepted. +#### Submitting Changes via Email +If you're not within our gitea instance and still like to contribute, you can send us your contributions to [git@vylpes.com](mailto:git@vylpes.com). + +For more information on how to do this, see the [git documentation](https://git-scm.com/docs/git-send-email). + #### JavaScript Styleguide All JavaScript code is linted with `eslint`. diff --git a/package.json b/package.json index cb5021b..f9b084f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "random-bunny", - "version": "2.0.1", + "version": "2.0.2", "description": "Get a random subreddit image url", "license": "MIT", "author": "Vylpes", @@ -26,8 +26,11 @@ "test": "echo none", "lint": "eslint ." }, - "bugs": "https://github.com/Vylpes/random-bunny/issues", - "homepage": "https://github.com/Vylpes/random-bunny", + "bugs": { + "url": "https://gitea.vylpes.xyz/RabbitLabs/random-bunny/issues", + "email": "helpdesk@vylpes.com" + }, + "homepage": "https://gitea.vylpes.xyz/RabbitLabs/random-bunny", "funding": "https://ko-fi.com/vylpes", "devDependencies": { "@types/node": "^16.11.11", diff --git a/readme.md b/readme.md index edccb31..0d05a3e 100644 --- a/readme.md +++ b/readme.md @@ -53,7 +53,8 @@ The json string which gets returned consists of: ## Links -* Discord: [Server Link](https://vylpes.xyz/discord) +* Discord: [Server Link](https://discord.gg/UyAhAVp) +* Support: [helpdesk@vylpes.com](mailto:helpdesk@vylpes.com) ## License -- 2.45.2 From 885e75e3f6acdd8d3a27c1741a13d3af934e7ab1 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Wed, 24 Aug 2022 13:57:22 +0100 Subject: [PATCH 5/9] Update CONTRIBUTING.md --- CONTRIBUTING.md | 189 +++--------------------------------------------- 1 file changed, 9 insertions(+), 180 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 971bb3d..fc5191a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -71,18 +71,9 @@ Provide more context by answering these questions: Include details about your configuration and environment: * **Which version of Random Bunny are you using?** You can get the exact version by running the `about` command. -* **Do you have any custom commands added to the commands folder?** If you do, provide information on what the command does, and a link to the command file if it exists. - -> **Note:** We do not provide any support on issues caused by custom commands. You are welcome to create an issue if you believe the issue is to do with the base code, but if the error is to do with that custom command we are unable to fix that, you will need to contact the author of that command. - * **What's the name and version of the OS you're using?** * **Are you running Random Bunny in a virtual machine?** If so, which VM software are you using and which operating systems and versions are used for the host and the guest? * **What version of node do you have installed?** You can get this version by running the `node -v` command in your terminal. -* **What does your `config.json` file look like?** - -> **Note:** remember to **not** give out your bot tokens which are inside of the `config.json` file. If you're giving a copy of your configuration remember to delete the tokens from the string and leave the empty. - -* **Are you running the bot in live or dev mode?** ### Suggesting Enhancements @@ -92,7 +83,7 @@ When you are creating an enhancement suggestion, please include as many details #### Before Submitting an Enhancement Suggestion -* **Check if the feature already exists.** Make sure to check on the latest version and if you can get the desired behaviour using the config options inside of `config.json` +* **Check if the feature already exists.** Make sure to check on the latest version * **Perform a search** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. #### How Do I Submit A (Good) Enhancement Suggestion? @@ -125,7 +116,6 @@ Install and build all of the dependencies using `npm` cd random-bunny yarn install ``` -And then use your text editor of choice to fill in the `config.json` file. #### Build and Run @@ -135,6 +125,10 @@ First, fork the Random Bunny repository so that you can make a pull request. The ```bash git clone https://gitea.vylpes.xyz//random-bunny.git + +# OR + +git clone https://codeberg.org/vylpes/random-bunny.git ``` Occasionally, you will want to merge changes in the upstream repository (the official code repo) with your fork. @@ -174,6 +168,9 @@ If you're not within our gitea instance and still like to contribute, you can se For more information on how to do this, see the [git documentation](https://git-scm.com/docs/git-send-email). +#### Submitting Changes via Codeberg +This code is mirrored on codeberg, although main development is done on my self-hosted Gitea instance, feel free to clone and create pull requests on there. I will merge it back into Gitea once accepted. + #### JavaScript Styleguide All JavaScript code is linted with `eslint`. @@ -233,172 +230,4 @@ We won't accept pull requests unless these checks pass. If yours fail, simply fi * **Arrow body style** should have braces around the body only when needed * **Arrow parameters** should have brackets around them only when needed * **Arrow spacing** should have a space around the arrow (' => ') -* **No var** should be used, instead use either let or const when appropriate - -## How You Can Contribute - -### Reporting Bugs - -This section guides you through submitting a bug report for Random Bunny. Following these guidelines helps maintainers and the community understand your report. reproduce the behaviour, and find related reports. - -When you are creating a bug report, please include as many details as possible. - -> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one. - -#### Before Submitting A Bug Report - -* **Perform a search** to see if the problem has already been reported. If it has **and the issue is still open**, add a comment to the existing issue instead of opening a new one. - -#### How You Can Submit A (Good) Bug Report - -Bugs are tracked as GitHub issues. After you've determined the bug you're reporting hasn't got a pre-existing **open** issue already, create an issue and provide information from below. - -* **Use a clear and descriptive title** for the issue to indentify the problem. -* **Describe the exact steps which reproduce the problem** in as many details as possible. For example, start by explaining how you started Random Bunny (if you're using your own instance), which command exactly you used, and the output which the bot replied with. If its your own instance, provide information on what the terminal output said, if any. -* **Provide specific examples to demonstrate the steps**. Include links to files or GitHub projects, or copy/pastable snippets, which you use in those examples. If you're providing snippets in the issue, use Markdown code blocks. -* **Describe the behaviour you observed after following the steps** and point out what exactly is the problem with that behaviour. -* **Explain which behaviour you expected to see instead and why.** -* **Include screenshots and animated GIFs** which show you following the described steps and clearly demonstrate the problem. -* **If the problem wasn't triggered by a specific action**, describe what you were doing before the problem happened and share more information using the guidelines below. - -Provide more context by answering these questions: - -* **Did the problem start happening recently** (e.g. after updating to a new version of Random Bunny) or was this always a problem? -* If the problem started happening recently, **can you reproduce the problem in an older version of Random Bunny?** What's the most recently version in which the problem doesn't happen? You can download older versions of Random Bunny from the releases page. -* **Can you reliably reproduce the issue?** If not, provide details about how often the problem happens and under which conditions it normally happens. - -Include details about your configuration and environment: - -* **Which version of Random Bunny are you using?** You can get the exact version by running the `about` command. -* **Do you have any custom commands added to the commands folder?** If you do, provide information on what the command does, and a link to the command file if it exists. - -> **Note:** We do not provide any support on issues caused by custom commands. You are welcome to create an issue if you believe the issue is to do with the base code, but if the error is to do with that custom command we are unable to fix that, you will need to contact the author of that command. - -* **What's the name and version of the OS you're using?** -* **Are you running Random Bunny in a virtual machine?** If so, which VM software are you using and which operating systems and versions are used for the host and the guest? -* **What version of node do you have installed?** You can get this version by running the `node -v` command in your terminal. -* **What does your `config.json` file look like?** - -> **Note:** remember to **not** give out your bot tokens which are inside of the `config.json` file. If you're giving a copy of your configuration remember to delete the tokens from the string and leave the empty. - -* **Are you running the bot in live or dev mode?** - -### Suggesting Enhancements - -This section guides you through submitting an enhancement suggestion for Random Bunny, including completely new features and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions. - -When you are creating an enhancement suggestion, please include as many details as possible. Fill out the suggestion with the steps that you imagine you would take if the feature you're requesting existed. - -#### Before Submitting an Enhancement Suggestion - -* **Check if the feature already exists.** Make sure to check on the latest version and if you can get the desired behaviour using the config options inside of `config.json` -* **Perform a search** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one. - -#### How Do I Submit A (Good) Enhancement Suggestion? - -Enhancement suggestions are tracked as GitHub issues. After you've determined the feature doesn't already exist or been suggested before, create an issue on that repository and provide the following information: - -* **Use a clear and descriptive title** for the issue to identify the suggestion. -* **Provide a step-by-step description of the suggested enhancement** in as many details as possible. -* **Provide specific examples to demonstrate the steps.** Include copy/pastable snippets which you use in those examples, as Markdown code blocks. -* **Describe the current behaviour** and **explain which behaviour you expected to see instead** and why. -* **Include screnshots and animated GIFs** which help you demonstrate the steps or point out the part of Random Bunny which the suggestion is related to. -* **Explain why this enhancement would be useful** to most Random Bunny users and isn't something that can or should be implemented as a custom command. -* **List some other bots where this enhancement exists.** -* **Specify which version of Random Bunny you're using.** You can get the exact version by running the `about` command. -* **Specify the name and version of the OS you're using.** - -### Your First Code Contribution - -Unsure where to begin contributing to Random Bunny? You can start by looking through these `good first` and `help wanted` issues - -#### Prerequisites - -In order to download necessary tools, clone the repository, and install dependencies via `yarn` you need network access. - -You'll need the following tools: - -* Git -* NodeJS -* Yarn - -Install and build all of the dependencies using `yarn` - -```bash -cd random-bunny -npm install -``` - -#### Build and Run - -If you want to understand how Random Bunny works or want to debug an issue, you'll want to get the source, build it, and run the tool locally. - -First, fork the Random Bunny repository so that you can make a pull request. Then, clone your fork locally: - -```bash -git clone https://gitea.vylpes.xyz//random-bunny.git -``` - -Occasionally, you will want to merge changes in the upstream repository (the official code repo) with your fork. - -```bash -cd random-bunny -git checkout master -git pull https://gitea.vylpes.xyz/RabbitLabs/random-bunny.git master -``` - -Manage any merge conflicts, commit them, and then push them to your fork. - -Go into `random-bunny` and build the package using `yarn build`. - -#### Pull Requests - -The process described here has several goals: - -* Maintain Random Bunny's quality -* Fix problems that are important to users -* Engage the community in working toward the best possible Random Bunny -* Enable a sustainable system for Random Bunny's maintainers to review contributions - -Please follow these steps to have your contribution considered by maintainers: - -* You mention the issue id which this pull request aims to fix -* After you submit your pull request, verify that all status checks are passing. - -> **Note**: If a check fails the pull request it is important that you go and fix these issues, or let us know that you no longer want to work on this issue by commenting on the pull request. Doing this will give you a better chance of having your pull request merged. - -* When the checks have passed a maintainer will review your code and ask for any improvements or questions, and will merge it if they are satisifed. - -While the prerequesites above must be satisifed prior to having your pull reuqest accepted, the reviewer(s) may ask you to complete additional design ork, tests, or other changes before your pull request can be ultimately accepted. - -#### Submitting Changes via Email -If you're not within our gitea instance and still like to contribute, you can send us your contributions to [git@vylpes.com](mailto:git@vylpes.com). - -For more information on how to do this, see the [git documentation](https://git-scm.com/docs/git-send-email). - -#### JavaScript Styleguide - -All JavaScript code is linted with `eslint`. - -* Prefer camelcase for variable names -* Prefer braces `{` to be on the same line -* Prefer no comma `,` dangle -* Prefer arrow function bodies to have brances `{}` only when needed -* Prefer arrow function parameters to have brackets `()` only when needed -* Prefer arrow function arrows `=>` to have a space before and after it -* Prefer `let` and `const` over `var` - -As well as eslint's recommended defaults. - -Example - -```js -function ban (member) { - let reason = "Example reason"; - - member.ban(reason).then(() => { - // handle then here - }).catch(err => { - // handle error here - }); -} \ No newline at end of file +* **No var** should be used, instead use either let or const when appropriate \ No newline at end of file -- 2.45.2 From 3d058663778e0ced23ed5716232cdce3e5d55bd0 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Wed, 24 Aug 2022 14:10:54 +0100 Subject: [PATCH 6/9] Switch package.json back because np will change it --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f9b084f..cb64d63 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "random-bunny", - "version": "2.0.2", + "version": "2.0.1", "description": "Get a random subreddit image url", "license": "MIT", "author": "Vylpes", -- 2.45.2 From bc38a83e444f11defe27de87eced8f41abe68186 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Wed, 24 Aug 2022 14:14:32 +0100 Subject: [PATCH 7/9] v2.0.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cb64d63..f9b084f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "random-bunny", - "version": "2.0.1", + "version": "2.0.2", "description": "Get a random subreddit image url", "license": "MIT", "author": "Vylpes", -- 2.45.2 From 011dbb85b2891b7e6f628e7171bae0c881f14d35 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Sat, 10 Dec 2022 12:44:53 +0000 Subject: [PATCH 8/9] Bump minimatch from 3.0.4 to 3.1.2 --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn.lock b/yarn.lock index 990ec18..7882faf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -284,7 +284,7 @@ color-name@~1.1.4: concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== create-require@^1.1.0: version "1.1.1" @@ -752,9 +752,9 @@ mimic-response@^3.1.0: integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" -- 2.45.2 From 9fca226ee314c273c58acf8a28006131a9c85398 Mon Sep 17 00:00:00 2001 From: Ethan Lane Date: Mon, 12 Dec 2022 18:42:21 +0000 Subject: [PATCH 9/9] Update discord links --- CONTRIBUTING.md | 4 ++-- readme.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fc5191a..e241a85 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ This project and everyone participating in it is governed by the Random Bunny Co > **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below. -You can ask a question about the project in the `#development` channel in the [Discord Server](https://discord.gg/UyAhAVp). +You can ask a question about the project in the `#development` channel in the [Discord Server](https://go.vylpes.xyz/A6HcA). You can also email with queries and support if you'd prefer at [helpdesk@vylpes.com](mailto:helpdesk@vylpes.com). @@ -210,7 +210,7 @@ This project and everyone participating in it is governed by the Random Bunny Co > **Note:** Please don't file an issue to ask a question. You'll get faster results by using the resources below. -You can ask a question about the project in the `#development` channel in the [Discord Server](https://discord.gg/UyAhAVp). +You can ask a question about the project in the `#development` channel in the [Discord Server](https://go.vylpes.xyz/A6HcA). ## What you should know diff --git a/readme.md b/readme.md index 0d05a3e..d129cf3 100644 --- a/readme.md +++ b/readme.md @@ -53,7 +53,7 @@ The json string which gets returned consists of: ## Links -* Discord: [Server Link](https://discord.gg/UyAhAVp) +* Discord: [Server Link](https://go.vylpes.xyz/A6HcA) * Support: [helpdesk@vylpes.com](mailto:helpdesk@vylpes.com) ## License -- 2.45.2