在我的服务器上,我有一个这样的硬币系统:
coin = []
if(msg.content === !coin){
coin[msg.author.discriminator] = 1 //i found this way to make an array with exclusive values for each user
msg.reply('now you have a gold coin :)')
}
现在这是问题所在:我需要机器人在一条消息中向我发送数组的每个对象以创建数据库,并发送如下信息:
if(msg.content === '!usercoin'){
msg.reply(coin[numbers != null]}
bot's reply: 1234:1 , 1235:1, 4444:1, 9999:1 //exemple that i need
答案 0 :(得分:0)
您需要执行msg.reply(coin.join(", "))
。另外,numbers
尚未定义,coin不是持久性的,因此,您应使用enmap
或mongodb
等数据库。Enmap的使用非常简单! Here is some examples。
PS:如果您使用的是heroku,则不能使用任何数据库