Jump to content


Photo
Question

Problems with accepting/ignoring group invites

node.js node-steam-user

  • Please log in to reply
2 replies to this topic

#1 ScorpionOfWar

ScorpionOfWar

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 19 April 2017 - 04:24 AM


sclient.on('groupRelationship', (steamid, relationship) => {
  groupSteamID = steamid;
  if(relationship === 2) {
    dbot.channels.get('302817074269519873').sendMessage('You have been invited to this group: "' + groupSteamID + '" \n If you want to accept the group request, reply with ``!accept group``. \n And if you want to decline it, reply with ``!decline group``.');
    console.log('New group invite to this group: "' + groupSteamID + '"');
  }
});
if (command === "accept-group") {
     sclient.accept(groupSteamID) = true;
    dbot.channels.get('302817074269519873').sendMessage("Accepted group invite: " + friendrqst);
    console.log("Accepted group invite: " + friendrqst);
  }

  if (command === "decline-group") {
    sclient.accept(groupSteamID) = false;
    dbot.channels.get('302817074269519873').sendMessage("Declined group invite: " + groupSteamID);
    console.log("Declined group invite: " + groupSteamID);
  }

I am using the node-steam module and the discord.js module just for you information.

 

 sclient.accept(groupSteamID) is not a function is my error when I try to accept/decline the invite


Edited by ScorpionOfWar, 19 April 2017 - 04:28 AM.


#2 ScorpionOfWar

ScorpionOfWar

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 19 April 2017 - 04:11 PM

Ok the error is back


Edited by ScorpionOfWar, 20 April 2017 - 05:05 PM.


#3 ScorpionOfWar

ScorpionOfWar

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 20 April 2017 - 05:07 PM

The error is back with the following code:

if (command === "accept") {
    if (argsresult === "group") {
      if (groupSteamID === "") {
        message.channel.sendMessage("No group invite to accept!");
        return;
      } else {
        sclient.respondToGroupInvite.accept(groupSteamID) = true;
        message.channel.sendMessage("Accepted group invite: " + friendrqst);
        console.log("Accepted group invite: " + friendrqst);
      }
    }
  }

  if (command === "decline") {
    if (argsresult === "group") {
      if (groupSteamID === "") {
        message.channel.sendMessage("No group invite to decline!");
        return; 
      } else {
        sclient.accept(groupSteamID) = false;
        message.channel.sendMessage("Declined group invite: " + groupSteamID);
        console.log("Declined group invite: " + groupSteamID);
      }
    }
  }

I tried the accept and decline command(sclient.accept and sclient.respondToGroupInvite.accept) Both give me the error that its no function

sclient.on('groupRelationship', (steamid, relationship) => {
  groupSteamID = steamid;
  
  if(relationship === 2) {
    dbot.channels.get('302817074269519873').sendMessage('You have been invited to this group: "' + groupSteamID + '" \n If you want to accept the group request, reply with ``!accept group``. \n And if you want to decline it, reply with ``!decline group``.');
    console.log('New group invite to this group: "' + groupSteamID + '"');

  }
});

Edited by ScorpionOfWar, 20 April 2017 - 05:07 PM.






Also tagged with one or more of these keywords: Question, node.js, node-steam-user

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users