Skip to content

This is a discordbot that was designed to give me more experience using javascript and hopefully help others in their journey as well!

Notifications You must be signed in to change notification settings

K-Lascar/UNSWDiscordBot

Repository files navigation

DiscordBot

This program is a DiscordBot, that I'm currently working on in order to get more experience using javascript and interacting with discord!

If you would like to use a discord bot that retrieves the handbook details for UNSW, please use this bot designed by both Office-Stapler and V-Wong here: https://github.com/Office-Stapler/handbook.

After planning what to do with this bot, I've decided we should have the following implementations:

IMPLEMENTATION

  1. Job Salary Search ✅

    • Depending on which field you are as a student, you may want to know what is the salary for your dream job.

    • I am thankful for Indeed for still having this ability in place (if it weren't, I wouldn't be able to have this functionality)

      • If Indeed removes this functionality, I will update the data source with reed (UK Salary Data) and/or usajobs.gov (US Government Data of Jobs).
      • I had problems understanding the documentation as some terms like publishers (this link redirects to hiring) no longer exist on the site, but are still used in the documentation. The most similar example to this implementation is jobbR, an Indeed API wrapper, however this package still uses the old publisher API (which no longer exists).
      salary
  2. Play ✅

    • If you would like to watch a movie or video that is already on discord, this bot has you covered!
  3. Whois (used similarly in the Dyno Bot: https://dyno.gg/) ✅

    • Retrieves the Joined Date

    • Retrieves the Creation Date

      whois
  4. Wikipedia (used similarly in the AlphaBot system https://www.alphabotsystem.com/alpha-bot):white_check_mark:

    • If a user queries a particular term using this command, they will receive a summary of this page alongside the image of that Wikipedia page as an embed.

    • Made possible with the [WikiJS module] (https://dijs.github.io/wiki/index.html)

      wiki
  5. Directions​ ✅

    • If a user asks for directions from a particular address, an image of that address and UNSW path will be generated using MapBox Direction's API.

    • Side note I used the path-gradients repo created by the MapBox team (more info in the .gitmodules).

      • I modified the code to fit the circumstances of this program (particularly retrieving arguments from the command line slicing them and swapping the Long and Lat using the provided coordsUtils.js). This was used instead of the hardcoded coordinates example.

        path-gradients/main.js
        const {swapLngLat} = require("./coordsUtils");
        // USE ARGV from process + and JSON.PARSE
        // https://stackoverflow.com/questions/41402834/convert-string-array-to-array-in-javascript
        
        var coordinates = JSON.parse(process.argv.slice(-1));
        const coords = swapLngLat(coordinates);
    • The map is outputted as an embed.

    directions
  6. Weather (used similarly in the old AlphaBot system https://www.alphabotsystem.com/alpha-bot and in the Facebook AI chatbot https://github.com/girliemac/fb-apiai-bot-demo/) ✅

    • Currently the weather is retrieved from OpenWeatherMap.org https://openweathermap.org/ and a map is retrieved from https://www.mapbox.com/ for the provided city.

    • Side note, thank you to both of these organisations for providing a service that is very useful and easy to use!

    • If a user would like to retrieve weather details from a particular city.

    • The current, forecasted max and min temperatures are retrieved.

    • A map of the location is outputted in a embed.

      weather
  7. Prefix Updater:white_check_mark:

    • Since discord channels may have multiple prefixes with their server bots (clashes), they may want to change what this bot's prefix is.

Happy Coding Everyone!!! 😄

About

This is a discordbot that was designed to give me more experience using javascript and hopefully help others in their journey as well!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published