Switch to environment variables

This commit is contained in:
Daniel Odendahl Jr
2017-04-05 21:18:26 +00:00
parent 4acc6b2f65
commit bd0869a3a9
13 changed files with 23 additions and 34 deletions
+2 -3
View File
@@ -1,6 +1,5 @@
const commando = require('discord.js-commando');
const request = require('superagent');
const config = require('../../config.json');
module.exports = class WebhookCommand extends commando.Command {
constructor(Client) {
@@ -12,7 +11,7 @@ module.exports = class WebhookCommand extends commando.Command {
],
group: 'textedit',
memberName: 'webhook',
description: 'Posts a message to the webhook defined in config. (;webhook Hey guys!)',
description: 'Posts a message to the webhook defined in your `process.env`. (;webhook Hey guys!)',
examples: [';webhook Hey guys!'],
guildOnly: true,
args: [{
@@ -35,7 +34,7 @@ module.exports = class WebhookCommand extends commando.Command {
try {
await message.delete();
await request
.post(config.webhook)
.post(process.env.WEBHOOK_URL)
.send({
content: content
});
+1 -2
View File
@@ -1,6 +1,5 @@
const commando = require('discord.js-commando');
const request = require('superagent');
const config = require('../../config.json');
module.exports = class YodaCommand extends commando.Command {
constructor(Client) {
@@ -28,7 +27,7 @@ module.exports = class YodaCommand extends commando.Command {
const response = await request
.get('https://yoda.p.mashape.com/yoda')
.set({
'X-Mashape-Key': config.mashapekey,
'X-Mashape-Key': process.env.MASHAPE_KEY,
'Accept': 'text/plain'
})
.query({