@@ -35,7 +35,7 @@ module.exports = async function(robot) {
35
35
await getDeploymentScripts ( )
36
36
37
37
// Get the devops channel ID. The topic will be used to determine what colour is staging / production when asked to deploy to either.
38
- const devopsChannel = robot . client . channels . find ( channel => channel . name === "chewie-skunkworks" ) ;
38
+ const devopsChannel = robot . client . channels . cache . find ( channel => channel . name === "chewie-skunkworks" ) ;
39
39
40
40
async function getDeploymentScripts ( ) {
41
41
await exec ( `rm -rf ./colony-deployment-scripts` ) ;
@@ -120,8 +120,8 @@ module.exports = async function(robot) {
120
120
// Can't @ users not in a chat with you, so this needs to be in public now
121
121
// if (!isPrivateDiscordMessage(robot.client, res)) return
122
122
if ( ! noAdmins ( brain ) && ! isAdmin ( user , brain ) ) return
123
- const channel = robot . client . channels . find ( x => x . id == res . message . room )
124
- const message = await channel . fetchMessage ( res . message . id )
123
+ const channel = robot . client . channels . cache . find ( x => x . id == res . message . room )
124
+ const message = await channel . messages . fetch ( res . message . id )
125
125
const who = message . mentions . users . first ( ) . id ;
126
126
127
127
if ( addUserWithRole ( who , 'admin' , brain ) ) {
@@ -142,8 +142,8 @@ module.exports = async function(robot) {
142
142
// if (!isPrivateDiscordMessage(robot.client, res)) return
143
143
if ( ! noAdmins ( brain ) && ! isAdmin ( user , brain ) ) return
144
144
145
- const channel = robot . client . channels . find ( x => x . id == res . message . room )
146
- const message = await channel . fetchMessage ( res . message . id )
145
+ const channel = robot . client . channels . cache . find ( x => x . id == res . message . room )
146
+ const message = await channel . messages . fetch ( res . message . id )
147
147
const who = message . mentions . users . first ( ) . id ;
148
148
149
149
if ( removeUserWithRole ( who , `admin` , brain ) ) {
@@ -172,8 +172,8 @@ module.exports = async function(robot) {
172
172
const where = res . match [ 1 ] . toLowerCase ( ) ;
173
173
if ( where !== "qa" && where !== "staging" && where !== "production" ) { return }
174
174
175
- const channel = robot . client . channels . find ( x => x . id == res . message . room )
176
- const message = await channel . fetchMessage ( res . message . id )
175
+ const channel = robot . client . channels . cache . find ( x => x . id == res . message . room )
176
+ const message = await channel . messages . fetch ( res . message . id )
177
177
const who = message . mentions . users . first ( ) . id ;
178
178
if ( ! noAdmins ( brain ) && ! isAdmin ( user , brain ) ) return
179
179
@@ -193,8 +193,8 @@ module.exports = async function(robot) {
193
193
const { brain } = robot
194
194
const where = res . match [ 1 ] . toLowerCase ( ) ;
195
195
if ( where !== "qa" && where !== "staging" && where !== "production" ) { return }
196
- const channel = robot . client . channels . find ( x => x . id == res . message . room )
197
- const message = await channel . fetchMessage ( res . message . id )
196
+ const channel = robot . client . channels . cache . find ( x => x . id == res . message . room )
197
+ const message = await channel . messages . fetch ( res . message . id )
198
198
const who = message . mentions . users . first ( ) . id ;
199
199
200
200
if ( ! noAdmins ( brain ) && ! isAdmin ( user , brain ) ) return
0 commit comments