More stuff.

Added a dice roll command.
This commit is contained in:
Terryiscool160 2020-03-10 00:18:05 +00:00 committed by GitHub
parent e2403b6cbe
commit f032e0c1e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 4 deletions

View file

@ -4,13 +4,13 @@ Woomy is a all-purpose discord bot built off the [guidebot](https://github.com/A
# How to use
The easiest way to use Woomy is to invite it to your server with [this link.](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=2134240503&scope=bot) It is hosted 24/7 and automatically updates itself when a new release is made available, making sure you always get the newest features.
Self hosting is generally not recommended, but instructions are provided below if you still wish to do so. Woomy's code will need to be modified before it will run on your machine.
You can also self-host! Some modificatiomns to the code will need to be made before Woomy will run on your machine, but anyone who can read errors will figure out what needs to be changed pretty quickly :P
# Requirements
- git
- node.js v12.0.0 or higher
- node-gyp build tools
- ffmpeg
- ffmpeg (or ffmpeg-static)
# Installation
- Clone Woomy to your machine
@ -18,4 +18,4 @@ Self hosting is generally not recommended, but instructions are provided below i
- Open config.js in your code editor and insert all the required information
# Contributing
If you wish to contribute to Woomy, please fork the repository and open a pull request.
If you wish to contribute to Woomy, please fork the repository and open a pull request. Any contribution is appreciated <3

27
src/commands/diceroll.js Normal file
View file

@ -0,0 +1,27 @@
exports.run = async (bot, message, args) => {
if (args.length === 0) {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
} else {
if (args[0].match(/^\d+$/)) {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}.`);
} else {
message.channel.send(`🎲 The dice landed on ${Array.from(Array(6).keys()).random() + 1}.`);
}
}
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["diceroll"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "dice",
category: "Fun",
description: "Rolls a dice.",
usage: "dice"
};