Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    n9cht
    @n9cht
    bild.png
    bild.png
    That's the error it throws ^
    Eric Gustavsson
    @SpyTec
    @n9cht if you add debug to the config, r.config({debug: true}), what calls does it make?
    n9cht
    @n9cht
    [debug] Received a 403 status code from a `post` request sent to https://oauth.reddit.com/api/set_suggested_sort?raw_json=1
    n9cht
    @n9cht
    Oh silly me, I know what the issue is.
    It just occurred to me that setSuggestSort isn't sorting comments, it's for setting the default suggested sort.
    Eric Gustavsson
    @SpyTec
    Yeah I'm unsure how to sort the comments.. there's an issue for it #194
    n9cht
    @n9cht
    I think it would make sense to have it as an option when you do fetchMore & fetchAll.
    bild.png
    You already have options to customise the way you want your comments; so comment sort would just be an extension of what is already there right?
    NGTmeaty
    @NGTmeaty
    is there an easy way to find the comment that was replied to from a PM? Essentially I send a message, a bot replies, I get a PM, and I'd like to get my original comment back.
    Eric Gustavsson
    @SpyTec
    @NGTmeaty If you use getInbox or getUnreadInbox you get a Listing of items, be it PM, Comment, Submission. For the latter two, they both have parent_id field which you can do what you want with
    Or rather, all probably have parent_id if it exists. Though for PM its a reply to another PM
    Bennett Rasmussen
    @bibyzan
    Hi all, not sure if I should open a new issue because not-an-aardvark/snoowrap#48 is still open, but I'm having an issue with react native 0.61.2. I'm able to import snoowrap and instance my client (with the modules suggested to install in the last comment), but as soon as I try and request any listings I get a Unhandled rejection Error: Exception in HostFunction: Malformed calls from JS: field sizes are different. I have more info I could put here or in an issue whatever appropriate thanks!!
    NGTmeaty
    @NGTmeaty
    yup, parent_id. Honestly didn't notice.
    also @bibyzan I'd comment on that issue with any additional data?
    Bennett Rasmussen
    @bibyzan
    thanks @NGTmeaty I put the bulk of the info in this issue not-an-aardvark/snoowrap#243 I can chat here or wherever!
    Osman Ullah
    @oullah
    Hello! So I am keeping track of all the submissions for a user. I've already fetched all the submissions once, so I don't want to fetch them all again next time. If I cache the fullname of the newest listing that I've received, is there any way to fetch only listings that are newer than that listing?
    Eric Gustavsson
    @SpyTec
    @oullah Hi there, for RedditUser.getSubmissions() you can provide listing options object as a parameter, that will be everything that's listed here https://www.reddit.com/dev/api#GET_user_{username}_submitted
    So you can do RedditUser.getSubmissions({sort: "new", after: fullname})
    Rein F
    @LevitatingBusinessMan
    Is there a way to check if a post is a crosspost?
    Eric Gustavsson
    @SpyTec
    @LevitatingBusinessMan there seems to be an optional property called crosspost_parent which will point to the parent if it's a crosspost
    Rein F
    @LevitatingBusinessMan
    I'll try that out, thank you
    That worked, thanks @SpyTec !!!
    Eric Gustavsson
    @SpyTec
    Np!
    Cy Bae
    @cybae0804
    Hey guys, I think this question probably has been asked 1000 times, but I am still unable to find a good explanation on how to implement this so I come here for help.
    I'm trying to make a web app for pulling a user's saved posts, and want to make it a frontend only thing. So I'm using snoowrap currently.
    I've used getAuthUrl/validateCode to get the code, saved the code to localstorage so that the user won't have to log in multiple times, but the reddit API throws an error when I try to reuse the code, so I think this is the wrong way.
    Is there a way for me to make this access permanent? And is authCode that I get a different thing entirely from access/refresh tokens?
    Cy Bae
    @cybae0804
    jk i dug through u/not-an-aardvark's comment history and found some answers.
    Eric Gustavsson
    @SpyTec
    @cybae0804 code is one-time use to get an access token. With the access token is how you keep someone logged in. Keep in mind that it will store the access token in plain text in the browser
    haykam821
    @haykam821
    When I get a mention on my bot account, it seems that it is a Comment and not a PrivateMessage
    Though this comment has .new but not #markAsRead
    Eric Gustavsson
    @SpyTec
    @haykam821 if the mention is in a Post or a Comment, that's what will be coming to your inbox. For marking as read see https://not-an-aardvark.github.io/snoowrap/snoowrap.html#markMessagesAsRead__anchor
    haykam821
    @haykam821
    ok, just making sure that behavior was intentional
    Another minor question: what reddit endpoint is for getting the reddit_session cookie/How can I authenticate for the reddit webpage?
    ilm9001
    @ilm9001
    how can i create a new top-level comment?
    jensen
    @jensechu_twitter
    Hellooo!! I am making a bot that scrapes modmails (which are discord invite applications) and posts them in a discord server. Then when a discord user reacts to approve/reject it generates a one time use link and sends to the user. All of that works fine however I am trying to archive the message afterwards and it throws a CANNOT BE ARCHIVED error.
    try { await r.getNewModmailConversation('fsox5').archive() } catch (error) { console.log(error) }
    Anyone know why a thread might be un-archivable?
    (I searched up for 'archive' and didn't see anything)
    Actually I think I know why. I parse it as JSON thus removing the methods. I will report back if that was the case once I know.
    Oh wait no that isn't right because I re-fetch the thread so this should be working. Hmmm
    jensen
    @jensechu_twitter
    fields":[null],"explanation":null,"message":"Unprocessable Entity","reason":"CONVERSATION_NOT_ARCHIVABLE"
    It seems to be hitting path: '/api/mod/conversations/fsox5/archive?raw_json=1', which is correct. I'll see whats up with reddit's API
    jensen
    @jensechu_twitter
    Alright if anyone else runs into this: I was trying to archive a thread that was sent between two moderators. Only threads between a non-mod and moderator can be archived. :)
    Eric Gustavsson
    @SpyTec
    @jensechu_twitter Seems like you already found out. One word of caution for the modmail implementation is that I forgot to implement a reply function for modmails, so as of right now you can't reply to convos unless you implement it on your end with oauth_request()