Skip to content
forked from Gelean/deldbot

Discord Bot written in Node.js

License

Notifications You must be signed in to change notification settings

leovander/deldbot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deldbot

Deldbot is a Discord Bot written in Node.js and using the plex-api library and several API endpoints

Software, Libraries, and APIs

Installation & Configuration

These steps provide a good walkthrough of creating and running a Discord bot: https://www.digitaltrends.com/gaming/how-to-make-a-discord-bot/

  1. Go to discordapp.com/developers/applications
  2. Click on New Application and supply a name
  3. Click on your new application
  4. Copy the Client ID and Client Secret
  5. Click on Bot under Settings on the left hand side
  6. Enter a username and copy the Token
  7. Check what permissions will be needed, all of the text permissions should be sufficient (522304)
  8. 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
  9. On this GitHub page click on Code -> Download ZIP
  10. Unzip the repository code somewhere on your machine
  11. Open up the windows CMD prompt and run as administrator (or whatever you use to run code)
  12. Change directory to the directory where the bot's code resides
  13. Optional if you run into cache issues with the following three commands: npm cache clean --force
  14. Run the following: npm install --global pm2
  15. Run the following: npm install
    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
  16. 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/
  17. Obtain an OMDb API Key from https://www.omdbapi.com/apikey.aspx
  18. Register an application and obtain an Imgur client id and secret from https://api.imgur.com/oauth2/addclient
  19. Obtain an ITAD API Key by setting up an account and creating a new application at https://isthereanydeal.com/dev/app
  20. 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
  21. 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.
  22. 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
  23. Run the following: pm2 start bot.js
  24. Voila, you can now start to issue commands in your discord server and test out if the bot is working right

Webhooks

  1. Discord Webhooks: https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks
  2. Plex Webhooks: https://tautulli.com/ and https://github.com/Tautulli/Tautulli-Wiki/wiki/Notification-Agents-Guide#discord
  3. GitHub Webhooks: https://gist.github.com/jagrosh/5b1761213e33fc5b54ec7f6379034a22
  4. Gitlab Webhooks: https://docs.gitlab.com/ee/user/project/integrations/webhooks.html
  5. Integromat: https://www.integromat.com/

Commands and Features

  • !help
    • Brings up the help menu
  • !usage <command>
    • Gives usage details for a given command
  • !serverstatus
    • Displays the Plex server status
  • !discordstatus
  • !search <query>
    • Searches the Plex server for anything matching the given query
  • !playlist [index]
    • Return a YouTube link from the playlist.txt file
  • !youtubesearch <query>
    • Return a YouTube video
  • !schwifty
    • Get Schwifty
  • !imgur [index]
    • Return an imgur link from an Imgur album specified in the config.js
  • !soitbegins
    • So it begins
  • !godwillsit
    • God wills it!
  • !absenceofgod
    • Absence of God
  • !dealwithit
    • Deal With It
  • !releasedate <query> [year]
    • Check the release date of a given movie through OMDb
  • !omdbsearch [p1-100] <query>
    • Run a search through OMDb and return the results
  • !howlongtobeat <query> OR !hltb <query>
    • Run a search through HowLongtoBeat and return the results
  • !isthereanydeal <query> OR !itad <query>
    • Run a search through IsThereAnyDeal and return the results
  • !8ball <query>
    • The Magic 8-Ball gives you a response for your yes/no query
  • !destroy @<user>
    • Destroy other users on the server
  • !uptime
    • Displays the current uptime of the bot
  • !repo
    • Displays the URL for this repo
  • !version
    • Displays the current version of the bot

Links and References

About

Discord Bot written in Node.js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%