"extra": {
"connectionLimit": 5
}
我如何检查行会中的人数成员?
discord.js version 12
答案 0 :(得分:0)
if(message.content === 'numberguild'){
message.channel.send((client.guilds.cache.get(message.guild.id).memberCount))
}
or
const a = (client.guilds.cache.get(message.guild.id).memberCount)
if(message.content === 'numberguild'){
message.channel.send(a + " members")
}
答案 1 :(得分:0)
将struct TestListView: View {
@State var strings = [
"Foo",
"Bar",
"Buzz",
]
var body: some View {
List(strings.indices) { index in
NavigationLink(destination: TestDetailView(selectedString: self.$strings[index])) {
Text(self.strings[index])
}
}
}
}
struct TestDetailView: View {
@Binding var selectedString: String // remove optional
var body: some View {
VStack {
TextField("Placeholder", text: $selectedString)
.padding()
.textFieldStyle(RoundedBorderTextFieldStyle())
Spacer()
}
}
}
的内容更改为message.channel.send()
还要在message.guild.memberCount
之后的.includes()
内将'numberguild'移到message.content
内,以免在您不想执行该命令时使用。
固定代码:
if(message.content.includes('numberguild')){ message.channel.send(message.guild.memberCount) }