(节点:10124)DeprecationWarning:Collection#find:改为传递一个函数
(node:10124) DeprecationWarning: Collection#find: pass a function instead
当我执行 !x 命令时,它说
(node:10124) DeprecationWarning: Collection#find: pass a function instead
(node:10124) DeprecationWarning: Collection#find: pass a function instead
问题出在 ...let channe.. ..downchan...
,如控制台日志所述
exports.startScrim = function(guild,host,type,time){
const embed = new RichEmbed()
.setColor(0x91bbff)
.addField("message x","another message"+exports.one(time),false)
.addField("Mode",type.toUpperCase(),true)
.addField("Host",host,true)
.addField("Instructions","message x",false)
let channel = guild.channels.find("name",guilds[guild.id].digitchan);
let channel2 = guild.channels.find("name",guilds[guild.id].countdownchan);
if (channel && channel2) {
channel.send(embed)`
下一行 channel.send(embed)
甚至没有执行。求助!
这看起来像是以下内容的副本:
Collection#find: pass a function instead
听起来你需要做:
let channel = guild.channels.find(channel => channel.name === guilds[guild.id].digitchan);
let channel2 = guild.channels.find(channel => channel.name === guilds[guild.id].countdownchan);
当我执行 !x 命令时,它说
(node:10124) DeprecationWarning: Collection#find: pass a function instead
(node:10124) DeprecationWarning: Collection#find: pass a function instead
问题出在 ...let channe.. ..downchan...
,如控制台日志所述
exports.startScrim = function(guild,host,type,time){
const embed = new RichEmbed()
.setColor(0x91bbff)
.addField("message x","another message"+exports.one(time),false)
.addField("Mode",type.toUpperCase(),true)
.addField("Host",host,true)
.addField("Instructions","message x",false)
let channel = guild.channels.find("name",guilds[guild.id].digitchan);
let channel2 = guild.channels.find("name",guilds[guild.id].countdownchan);
if (channel && channel2) {
channel.send(embed)`
下一行 channel.send(embed)
甚至没有执行。求助!
这看起来像是以下内容的副本: Collection#find: pass a function instead
听起来你需要做:
let channel = guild.channels.find(channel => channel.name === guilds[guild.id].digitchan);
let channel2 = guild.channels.find(channel => channel.name === guilds[guild.id].countdownchan);