Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* utils: modules exported from single index.js file * .lock files: removed; no need for lock files in project. * update: add .lock files * changed order of sections * lable firebase console log * bot activity set to `!helpme` * code formatting * login procedure update: changed log messages * refactoring, formating, organisation * formatting and refactoring * date change on license * some formatting * improved poll command
- Loading branch information
1 parent
2c7868f
commit ba882da
Showing
13 changed files
with
319 additions
and
10,211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,8 @@ config.json | |
dist/ | ||
|
||
# log files | ||
logs/*.log | ||
logs/*.log | ||
|
||
# lock files | ||
package-lock.json | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,21 @@ | ||
const Auth = require('../utils/auth'); | ||
const { auth } = require('../utils'); | ||
|
||
exports.run = (message, args) => { | ||
exports.run = async (message, args) => { | ||
|
||
if (Auth.isAdmin(message.member)) { | ||
if(!args || args.length < 1) return message.reply("Must provide the text of the poll question after the command."); | ||
if (auth.isAdmin(message.member)) { | ||
|
||
if(!args || args.length < 1) | ||
return message.reply("Please provide description of poll after command name."); | ||
|
||
const question = args.join(' ') | ||
|
||
let text = "**POLL:** " + question | ||
|
||
message.channel.send(text) | ||
.then(function (msg) { | ||
msg.react("✅") | ||
msg.react("❌") | ||
}).catch(function() { | ||
//Something | ||
}); | ||
message.delete(); | ||
const msg = await message.channel.send(`Hey everyone, ${message.author} have started a poll.\n\`\`\`${question}\`\`\``); | ||
await msg.react("✅"); | ||
await msg.react("❌"); | ||
await message.delete(); | ||
|
||
} else { | ||
message.reply('You must be an admin in order to run this command.'); | ||
await message.reply('You must be an admin in order to run this command.'); | ||
} | ||
|
||
}; |
Oops, something went wrong.