Skip to content

Commit 1c50a71

Browse files
authored
Merge pull request #24 from Gelean/overhaul
Overhaul
2 parents 2ee439f + 5f8bce1 commit 1c50a71

33 files changed

+4090
-1383
lines changed

README.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
# deldbot
22

3-
Deldbot is a Discord Bot written in Node.js and using the plex-api library and several API endpoints
3+
Deldbot is a Discord Bot written in Node.js, utilizing Discord.js and several other open source libraries
44

55
## Software, Libraries, and APIs
66

7-
* [NodeJS 12.16.2+](https://nodejs.org/en/download/)
7+
* [Node.js 14.16.1+](https://nodejs.org/en/download/)
8+
* [npm 6.14.12+](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
9+
* [Jest ^27.2.0+](https://jestjs.io/)
10+
* [discord.js 12.5.3+](https://www.npmjs.com/package/discord.js/)
11+
* [d20 1.4.1+](https://www.npmjs.com/package/d20)
812
* [plex-api 5.3.1+](https://www.npmjs.com/package/plex-api/)
9-
* [discord.io 2.5.3+](https://izy521.gitbooks.io/discord-io/content/)
10-
* [discord.io-gateway6 2.5.3+](https://www.npmjs.com/package/discord.io/)
11-
* [discord.js 12.2.0+](https://www.npmjs.com/package/discord.js/)
12-
* [howlongtobeat 1.2.1+](https://www.npmjs.com/package/howlongtobeat/)
13+
* [howlongtobeat 1.5.0+](https://www.npmjs.com/package/howlongtobeat/)
1314
* [itad-api-client-ts 1.0.4+](https://www.npmjs.com/package/itad-api-client-ts/)
14-
* [pm2 4.5.6+](https://www.npmjs.com/package/pm2)
15-
* [popyt 4.2.0+](https://www.npmjs.com/package/popyt)
15+
* [pm2 5.1.1+](https://www.npmjs.com/package/pm2)
16+
* [popyt ^5.0.0+](https://www.npmjs.com/package/popyt)
1617
* [Plex API](https://github.com/Arcanemagus/plex-api/wiki/)
1718
* [OMDb API](https://www.omdbapi.com/)
1819
* [Imgur API](https://api.imgur.com/)
20+
* [IsThereAnyDeal API](https://itad.docs.apiary.io/#)
1921
* [HowLongToBeat API](https://itad.docs.apiary.io/)
2022
* [Youtube Data API](https://developers.google.com/youtube/v3)
2123

@@ -33,22 +35,25 @@ These steps provide a good walkthrough of creating and running a Discord bot: ht
3335
1. Open up the following URL, replacing the CLIENT_ID and permissions with your own values: https://discordapp.com/oauth2/authorize?&client_id=CLIENT_ID&scope=bot&permissions=0
3436
1. On this GitHub page click on Code -> Download ZIP
3537
1. Unzip the repository code somewhere on your machine
36-
1. Open up the windows CMD prompt and run as administrator (or whatever you use to run code)
37-
1. Change directory to the directory where the bot's code resides
38-
1. Optional if you run into cache issues with the following three commands: npm cache clean --force
39-
1. Run the following: npm install --global pm2
38+
1. Open up the Windows CMD prompt and run as administrator or open up a Linux terminal
39+
1. Change directory to where the downloaded code resides
4040
1. Run the following: npm install
41-
1. The above should work with the package.json, but if you want to get it working manually, run: npm install discord.io winston plex-api howlongtobeat itad-api-client-ts discord.js popyt pm2 https://github.com/woor/discord.io/tarball/gateway_v6
41+
1. Optional: if you run into cache issues use the following: npm cache clean --force
4242
1. Obtain the Plex token of your server by referencing the following link: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
4343
1. Obtain an OMDb API Key from https://www.omdbapi.com/apikey.aspx
4444
1. Register an application and obtain an Imgur client id and secret from https://api.imgur.com/oauth2/addclient
4545
1. Obtain an ITAD API Key by setting up an account and creating a new application at https://isthereanydeal.com/dev/app
4646
1. Obtain a Youtube API Key by setting up an account and creating a new application at https://console.developers.google.com/apis/credentials and enable the YouTube Data API v3 at https://console.developers.google.com/apis/api/youtube.googleapis.com/overview
4747
1. Update config.js with the client id, client secret, discord token, plex id, plex token, username, password, plex token, plex server hostname, plex server port, omdb api key, imgur client id, imgur client secret, the id of the imgur album you wish to use, itad key, and your Youtube API key. Some of these are optional depending on what functionality you want to use.
4848
1. In Discord, go to User Settings > Appearance, enable Developer Mode, right-click your username, Copy ID, paste that number into USERID in config.js in the ownerId row
49-
1. Run the following: pm2 start bot.js
49+
1. Run the following: node start bot.js
50+
1. If you wish to use pm2 to run the bot and ensure it restarts automatically from crashes, run the following: pm2 start bot.js
5051
1. Voila, you can now start to issue commands in your discord server and test out if the bot is working right
5152

53+
## Running Jest Tests
54+
55+
npm run test
56+
5257
## Webhooks
5358

5459
1. Discord Webhooks: https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks
@@ -106,11 +111,10 @@ These steps provide a good walkthrough of creating and running a Discord bot: ht
106111

107112
## Links and References
108113

109-
* https://www.themoviedb.org/documentation/api?language=en-US
110114
* https://discordjs.guide/
115+
* https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID
111116
* https://cog-creators.github.io/discord-embed-sandbox/
112-
* https://github.com/v0idp/Mellow
117+
* https://www.themoviedb.org/documentation/api?language=en-US
113118
* https://rapidapi.com/imdb/api/movie-database-imdb-alternative
114119
* https://izy521.gitbooks.io/discord-io/content/Methods/Handling_audio.html
115-
* https://gifrun.com
116-
* https://support.discord.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID-
120+
* https://gifrun.com

0 commit comments

Comments
 (0)