so i mean
function getGroup(groupName,callback) {
groupmembers = [];
community.getSteamGroup(groupName, (err, group) => {
if (err) {
console.log("Couldn't get the Group Retrying");
setTimeout((groupName) => { getGroup(groupName,callback) }, 5000);
} else group.getMembers((err, members) => {
if (err) {
console.log("Couldn't get the Group Retrying..");
setTimeout((groupName) => { getGroup(groupName,callback) }, 5000);
} else {
members.forEach(member => {
groupmembers.push(member.accountid);
});
callback(groupmembers);
console.log("Loaded The Group Members");
}
});
});
}
client.on("friendMessage", function (steamID, message) {
getGroup("mygroupname",members => {
if (members.length > 0) {
if (message == "!test") {
if (members.includes(steamID.accountid)) {
client.chatMessage(steamID, "Test Message");
}
else client.chatMessage(steamID, "You have to join our steam group");
}
}
else {
client.chatMessage(steamID, "bot is still loading message");
}
} else if (message == "!help") {
client.chatMessage(steamID, "Test Message");
} else {
client.chatMessage(steamID, "You wrote an unknown command. You can type !commands to learn commands.");
}
console.log("Message Sender steamID: " + steamID.getSteam3RenderedID() + ": " + message);
});
this is the sample code
I can only use the first command, I want everyone to use the other commands, but other commands don't work
so !help doesn't work
I hope you understand thanks in advance <3