Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump axios from 0.18.0 to 0.18.1 #16

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion external-scripts.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[
"hubot-diagnostics",
"hubot-help",
"hubot-github-status",
"hubot-redis-brain",
"hubot-slack-reaction"
]
30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,34 @@
"description": "A handy bot for doing Colony things",
"scripts": {
"start": "env-cmd .env yarn run hubot --name chewie -a slack",
"start-discord": "env-cmd .env yarn run hubot --name chewie -a discord",
"start-discord": "env-cmd .env yarn run hubot --name chewie -a discobot",
"dev": "env-cmd .env yarn run hubot --name chewie"
},
"dependencies": {
"@colony/colony-contract-loader-network": "^1.0.1",
"@colony/colony-js-adapter-ethers": "^1.4.1",
"@colony/colony-js-client": "^1.5.1",
"@slack/client": "^4.3.1",
"@colony/colony-js-adapter-ethers": "^1.14.3",
"@colony/colony-js-client": "^1.14.8",
"@slack/client": "^4.12.0",
"await-exec": "^0.1.2",
"chrono-node": "^1.3.5",
"chrono-node": "^1.4.8",
"coffee-script": "^1.12.7",
"cron": "^1.3.0",
"cron": "^1.8.2",
"env-cmd": "^8.0.2",
"ethers": "^3.0.21",
"figma-js": "^1.3.4",
"ethers": "^3.0.29",
"figma-js": "^1.14.0",
"githubot": "^1.0.1",
"hubot": "^3.3.2",
"hubot-diagnostics": "0.0.2",
"hubot-discobot": "^1.0.2",
"hubot-discord": "^2.1.0",
"hubot-github-status": "^0.2.1",
"hubot-discobot": "^1.0.4",
"hubot-help": "^0.2.2",
"hubot-redis-brain": "^0.0.4",
"hubot-slack": "^4.5.3",
"hubot-slack-reaction": "^0.0.4",
"moment-timezone": "^0.5.31",
"node-fetch": "^2.6.1",
"promise.allsettled": "^1.0.4",
"request": "^2.88.0",
"request-promise-native": "^1.0.7",
"moment-timezone": "^0.5.34",
"node-fetch": "^2.6.6",
"promise.allsettled": "^1.0.5",
"request": "^2.88.2",
"request-promise-native": "^1.0.9",
"spacetime-informal": "^0.3.0"
},
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions scripts/bsg.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const { isChannel, isPrivateDiscordMessage } = require('./utils/channels');

module.exports = function(robot) {
robot.hear(/@Chewie, what do you hear\?/, async (res) => {
robot.hear(/<@!720953382789185548>, what do you hear\?/, async (res) => {
if (res.message.user.id !='273398423787536384') return
res.send('Nothing but the rain.');
res.robot.adapter.send(res.envelope, 'Nothing but the rain.');
})
}
20 changes: 10 additions & 10 deletions scripts/daily-standup.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const getTimezoneFromMap = getBrain('timezones').getFromMap
const BRAIN_PREFIX = 'standup-discord';
// This is the daily-standup channel. This should be an env variable at some point
// #Skunkworks
// const HUBOT_STANDUP_CHANNEL = '720952130562687016';
const HUBOT_STANDUP_CHANNEL = '718537795068625036';
const HUBOT_STANDUP_CHANNEL = '720952130562687016';
// const HUBOT_STANDUP_CHANNEL = '718537795068625036';
// #standup-testing channel
// const HUBOT_STANDUP_CHANNEL = 'CBX6J6MAA'

Expand Down Expand Up @@ -171,7 +171,7 @@ const checkStandupsDone = robot => {
const standuppers = Object.values(getMap('standuppers', brain))

if (nobodyHadToWorkToday(standuppers, day)) {
return robot.messageRoom(
return robot.messageChannel(
HUBOT_STANDUP_CHANNEL,
'Yesterday was a free day for everyone! Hope you enjoyed it 🏝'
)
Expand All @@ -190,7 +190,7 @@ const checkStandupsDone = robot => {
const praises = Object.values(getMap('praises', brain))
const randomIdx = Math.floor(Math.random() * praises.length)
const randomPraise = praises[randomIdx]
robot.messageRoom(
robot.messageChannel(
HUBOT_STANDUP_CHANNEL,
`Everyone did their standups yesterday! ${randomPraise ||
'That makes me a very happy Wookiee!'}`
Expand All @@ -200,14 +200,14 @@ const checkStandupsDone = robot => {
const randomIdx = Math.floor(Math.random() * phrases.length)
const randomPhrase = phrases[randomIdx]
if (usersToShame.length === 1) {
robot.messageRoom(
robot.messageChannel(
HUBOT_STANDUP_CHANNEL,
`Only <@${usersToShame[0].id}> forgot to do their standup yesterday. ${randomPhrase}`
)
} else {
const displayUsers = usersToShame.slice()
const lastUser = displayUsers.pop()
robot.messageRoom(
robot.messageChannel(
HUBOT_STANDUP_CHANNEL,
displayUsers.map(user => `<@${user.id}>`).join(', ') +
` and <@${lastUser.id}> did not do their standups yesterday. ${randomPhrase}`
Expand Down Expand Up @@ -285,7 +285,7 @@ const setupCronJob = robot => {
cronTime: '0 46 23 * * 0',
onTick: () => {
const leaderboard = getLeaderboard(true, robot.brain)
robot.messageRoom(HUBOT_STANDUP_CHANNEL, leaderboard)
robot.messageChannel(HUBOT_STANDUP_CHANNEL, leaderboard)
},
start: false,
// Last time zone of the day (UTC-11)
Expand All @@ -295,7 +295,7 @@ const setupCronJob = robot => {
}

module.exports = robot => {
const { brain, messageRoom } = robot
const { brain, messageChannel } = robot
setupCronJob(robot)

// These lines are for debugging. Please leave in and commented for now
Expand Down Expand Up @@ -460,8 +460,8 @@ module.exports = robot => {
}

addToMap(date, res.message.user.id, hour, brain)
const channel = robot.client.channels.find(x => x.id == res.message.room)
const message = await channel.fetchMessage(res.message.id)
const channel = robot.client.channels.cache.find(x => x.id == res.message.room)
const message = await channel.messages.fetch(res.message.id)
message.react(":chewie:719957751316611172")
})

Expand Down
4 changes: 2 additions & 2 deletions scripts/deleteTelegramCaptchas.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const { isChannel, isPrivateDiscordMessage } = require('./utils/channels');

module.exports = function(robot) {
robot.hear(/^[0-9]{4}$/, async (res) => {
const channel = robot.client.channels.find(x => x.id == res.message.room)
const message = await channel.fetchMessage(res.message.id)
const channel = robot.client.channels.cache.find(x => x.id == res.message.room)
const message = await channel.messages.fetch(res.message.id)
message.delete()
})
}
18 changes: 9 additions & 9 deletions scripts/deployments.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = async function(robot) {
await getDeploymentScripts()

// Get the devops channel ID. The topic will be used to determine what colour is staging / production when asked to deploy to either.
const devopsChannel = robot.client.channels.find(channel => channel.name === "chewie-skunkworks");
const devopsChannel = robot.client.channels.cache.find(channel => channel.name === "chewie-skunkworks");

async function getDeploymentScripts() {
await exec(`rm -rf ./colony-deployment-scripts`);
Expand Down Expand Up @@ -120,8 +120,8 @@ module.exports = async function(robot) {
// Can't @ users not in a chat with you, so this needs to be in public now
// if (!isPrivateDiscordMessage(robot.client, res)) return
if (!noAdmins(brain) && !isAdmin(user, brain)) return
const channel = robot.client.channels.find(x => x.id == res.message.room)
const message = await channel.fetchMessage(res.message.id)
const channel = robot.client.channels.cache.find(x => x.id == res.message.room)
const message = await channel.messages.fetch(res.message.id)
const who = message.mentions.users.first().id;

if (addUserWithRole(who, 'admin', brain)) {
Expand All @@ -142,8 +142,8 @@ module.exports = async function(robot) {
// if (!isPrivateDiscordMessage(robot.client, res)) return
if (!noAdmins(brain) && !isAdmin(user, brain)) return

const channel = robot.client.channels.find(x => x.id == res.message.room)
const message = await channel.fetchMessage(res.message.id)
const channel = robot.client.channels.cache.find(x => x.id == res.message.room)
const message = await channel.messages.fetch(res.message.id)
const who = message.mentions.users.first().id;

if (removeUserWithRole(who, `admin`, brain)) {
Expand Down Expand Up @@ -172,8 +172,8 @@ module.exports = async function(robot) {
const where = res.match[1].toLowerCase();
if (where !== "qa" && where !== "staging" && where !== "production") { return }

const channel = robot.client.channels.find(x => x.id == res.message.room)
const message = await channel.fetchMessage(res.message.id)
const channel = robot.client.channels.cache.find(x => x.id == res.message.room)
const message = await channel.messages.fetch(res.message.id)
const who = message.mentions.users.first().id;
if (!noAdmins(brain) && !isAdmin(user, brain)) return

Expand All @@ -193,8 +193,8 @@ module.exports = async function(robot) {
const { brain } = robot
const where = res.match[1].toLowerCase();
if (where !== "qa" && where !== "staging" && where !== "production") { return }
const channel = robot.client.channels.find(x => x.id == res.message.room)
const message = await channel.fetchMessage(res.message.id)
const channel = robot.client.channels.cache.find(x => x.id == res.message.room)
const message = await channel.messages.fetch(res.message.id)
const who = message.mentions.users.first().id;

if (!noAdmins(brain) && !isAdmin(user, brain)) return
Expand Down
2 changes: 1 addition & 1 deletion scripts/logDiscordErrors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Logs errors from the discord library, which bubble up by design

module.exports = async function(robot) {
robot.adapter.client.on('error', function(err) {
robot.client.on('error', function(err) {
console.log(err);
});
}
4 changes: 2 additions & 2 deletions scripts/timezones.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const {
module.exports = robot => {
const { brain, messageRoom } = robot

robot.hear(/^Chewie: !timezone set (.+)$/, res => {
robot.hear(/^!timezone set (.+)$/, res => {
if (!isPrivateDiscordMessage(robot.client, res) ) return
// Do they already have it set?
const zone = getFromMap('users', res.message.user.id, brain);
Expand All @@ -34,7 +34,7 @@ module.exports = robot => {
res.send(`You have set your timezone to \`${newZone}\`. If I've understood wrong, try again and try being more specific`);
})

robot.hear(/^Chewie: !timezone$/, res => {
robot.hear(/!timezone$/, res => {
console.log(res);
if (!isPrivateDiscordMessage(robot.client, res) ) return
console.log('whee')
Expand Down
3 changes: 2 additions & 1 deletion scripts/utils/channels.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
const isPrivateSlackMessage = res => res.message.room.startsWith('D');
const isPrivateDiscordMessage = (client, res) => {
console.log(client,res)
// Get user
const user = client.users.get(res.message.user.id);
const user = client.users.cache.get(res.message.user.id);
// Get their DM channel with the bot
const channel = user.dmChannel
// Is that where we saw the message?
Expand Down
Loading