Discord.js bot
run npm install
to install all dependencies
create a JSON file named config.json
, that will contain the token and the prefix for your version of the bot.
{
"prefix": "prefix",
"token": "token",
"errColour": "#ff2424",
"successColour": "#5cff5f",
"rapidapiKey": "bing image search through RapidAPI", // Required for image command to work
"rapidapiHost": "bing image search through RapidAPI", // Required for image command to work
"currconv": "free currency conversion api key", // Required for exchange command to work. get key at https://free.currencyconverterapi.com/
}
To compile from TypeScript to javascript, open the root directory and run tsc -p .
If you want it to compile automatically while you edit, run npm run watch
.
To start the bot run npm start
. This will use nodemon to automatically restart the bot after changes are detected.
,avatar <@user>
Returns the avatar from the chosen user. If no user is provided, returns your own avatar.
No argument Pinging user
,user <@user>
Returns information about a user, such as account creation date, ID and custom status. If user is in the server you called the command on, will also provide information such as the roles they have and when they joined the server. If no user is profided, returns information about yourself. Also works if you provide user IDs
Mentioning user Using ID
,calc <expression>
Takes a mathematical expression and returns the answer. You can use "^" or "**" for exponents.
,convert <10m> <ft>
Converts the given value and its unit to the desired unit. Works to convert from different units.
System conversion Temperature conversion
,exchange [<amount>]<from currency> <to currency>
Performs currency exchange. If no amount is passed, returns the regular value. Currencies do not need to be in uppercase
With amount Without amount
,r <dice amount>d<dice size> [<operation> <number>]
Rolls the desired amount of die and then performs the appropriate calculations.
Example Wrong usage Correct usage
,8ball <yes or no question>
Replies to a yes or no question.
,wiki <query>
Searches Wikipedia for an article and returns a 3 sentence summary.
,image <query>
Searches for images and returns a reaction meny with the different images.