Skip to content

Repository files navigation

StatsBot - A Discord Bot to gather data from public APIs

CodeQL

Note
This project does participate in the Hacktoberfest 2022 event!

A Discord bot which provides various commands to get data from public APIs. This project is using the discord.js library and public APIs from this list or other ressources.

✨ How to contribute

Warning
For the duration of Hacktoberfest 2022, only one issue/pull request per person will be accepted. If you want to contribute more, please look for other repositories here and keep contributing ❤️

  • Navigate to an open issue and ask to be assigned to it (or create one yourself)
  • After you are assigned, fork the repository and create a new branch
  • Make your changes on the new branch and commit them
  • Create a pull request and wait for it to be reviewed
  • Thats it!

For more information check out the Contribution Guidelines

✅ Available commands

CommandDescriptionAPI
/invitelinkShows the invite link for the bot
/pingPong!
/serverinfoShows information about the server
/userinfoShows information about the user
/excuseSends a random excuseExcuser
/show-chess-leaderboardShows information about the current chess.com leaderboardchess.com
/triviaShows a random question, react with ✅ or ❌.opentdb.com
/numberfactShows a random number factnumbersapi.com
/catfactShows a random fact about cats.meowfacts
/dogfactShows a random fact about dogs.Dog API
/dictionaryGet definitions and synonyms of words.dictionaryapi
/foxpicShows a random picture of a fox.RandomFox
/mathquestionSends a random math question.xMath API
/uptimeShows how long Stats-Bot has been up.Countdown NPM Package
/cryptoProvide detail about given crypto currency.coinstat
/motivationShows a random motivation quote.motivation
/breakingbadShows a random Breaking Bad quote.Breaking Bad Quotes Api
/dogpicShows a random dog picture.Dog Pic API
/catpicShows a random cat picture.Cat Pic API
/duckpicShows a random duck picture.Duck Pic API
/jokeGive you a random joke.Joke API
/chuckShows a random joke about Chuck NorrisChuck Norris API
/animequoteShows a random anime quote.anime-chan
/boredGet something to do if you are bored.Bored API
/kanyeShows a random quote by Kanye West.Kanye Rest API
/websiteiconShows the favicon of the requested sit.Icon Horse API
/guessageGuess the age of a specific or random name.Agify API, Random Data API
/npmQuery the NPM registry for npm package details.NPM Registry
/stockimageGet a random 1920x1080p stock image.Lorem Picsum
/tecchyShows a random tech-savvy phrase.TechyAPI
/affirmationShows a random affirmation quote.Affirmation Dev API
/seriesGet any tv/web series informationCatchTheShow
/memeSend Random Memes.Reddit Random Memes Api
/list-data-breachesLists data breaches using the haveibeenpwned.com APIhaveibeenpwned.com
/onthisdayShows a random history event happended on this date.ZenQuotes
/fruitGet interesting information about fruitFruityvice
/serveripDisplay server IP and locationMyIP API
/guessnationalityGuess the country of a specific or random name.Nationalize API, Random Data API
/countryinfoDisplay information about a specific country.REST Countries
/universityGet the domain of a university.Hipo
/countryinfoDisplay information about a specific country.REST Countries
/breakingbaddeathShows a random death reason of a Breaking Bad characterBreaking Bad Death Api
/adviceShows a random advice.Advice Slip API
/shibaShow shiba inu picture.shibe.online
/yesnoGet an answer to any question.yesno.wtf
/xkcdShows a random xkcd comic.xkcd Swagger REST API
/roboavatarCreate a Robotor Avatar by entering a string.Robo Avatar API
/inspirationGet Inspiration.goprogram API
/horoscopeGet Horscope.Aztro Api
/whatshouldieatGet a random recipe from themealdb.themealdb API
/ayahGet a verse of Quran.AlQuran Cloud
/encryptionEncrypt/decrypt a message using a key.Classify API
/eartheventReturn a natural event that occurred in the last 30 days.EONET API
/apodReturn an astronomy picture of the day.NASA APOD API
/truefactGet a true fact.Random Useless Facts API
/createloripsumShows random lorem ipsum text.Loripsum
/urbanShows the definition of a term from Urban Dictionary.Urban Dictionary API
/guessgenderGet the gender of a name.Genderize
/shortenlinkShorten the URL.GoTiny
/locateisslocate the International Space Station.open-notify

🔧 Installation

Prerequisites

  • Node.js (v16.14.0 or higher)
  • Discord Account

Project Setup

  1. Fork or Clone the repository to your local machine
  2. Navigate to the project root directory (location of package.json)
  3. Run the command npm install to install all dependencies
  4. Setting up a discord bot application
    • Follow this guide on how to set up a new discord application and add a bot
    • Save the Bot Token, Client ID and Client Secret to a new file named .env in the project root directory

Example .env file content:

DC_BOT_TOKEN=<yourbottoken>
DC_BOT_CLIENT_ID=<yourapplicationclientid>
DC_BOT_CLIENT_SECRET=<yourapplicationclientsecret>
DC_BOT_PERMISSIONS=274878131264

🚀 How to run the bot

npm run dev

This runs the application with nodemon which automatically restarts the application when changes are made.

🔗 How to invite the bot

  • Option 1: Follow this guide on discordjs.guide
  • Option 2: Use the base Url https://discord.com/api/oauth2/authorize and add following url parameters:
    • client_id: Your application client id (DC_BOT_CLIENT_ID)
    • permissions: All permissions the bot should have when invited as a string (274878131264)
    • scope: bot%20applications.commands

❓ What is Hacktoberfest?

A month-long celebration from October 1st - 31st sponsored by Digital Ocean and GitHub to get people involved in Open Source.

Create your very first pull request to any public repository on GitHub and contribute to the open source developer community.

About

Discord Bot to gather stats from public APIs using node.js and discord.js!

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages