Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    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()
    jensen
    @jensechu_twitter
    @SpyTec I've been replying just fine to modmails!

    ```const sendModMail = async (threadID, message) => {
    const thread = r.getNewModmailConversation(threadID)

    await thread.reply(message);
    await archiveThread(threadID)
    }```

    Eric Gustavsson
    @SpyTec
    Hm.. let me check then what it is I forgot to implement
    jensen
    @jensechu_twitter
    I can't do private modmail notes
    If that is what you meant
    (Or I can't find how to at least :D )
    Eric Gustavsson
    @SpyTec
    Hm. Seems like reply isn't in the docs, though I did implement it in the code. Anyhow, for private modmail notes there's a second argument you can pass https://github.com/not-an-aardvark/snoowrap/blob/master/src/objects/ModmailConversation.js#L99-L106
    jensen
    @jensechu_twitter
    Oh awesome!!
    This is great thank you!
    This whole library was really easy to use. Thanks for making it.
    I particularly enjoy that the request handler retries on 503s. I didn't expect reddit to 503 so much
    Eric Gustavsson
    @SpyTec
    99% of the work goes to not-an-aardvark :D
    jensen
    @jensechu_twitter
    Oh right! Well thanks to them and all contributors ^0^
    Eric Gustavsson
    @SpyTec
    🎉
    Tomáš Hvozdovič
    @thvozdovic
    Hello, how can I add permissions to the bot in some subreddits so it can remove, approve etc.?