6
retoor
2y

I am working on an AoK bot. It worked before but now it fails on me. It says: {'success': False, 'error': 'Invalid comment.'}

I don't know why.

This is the comment: "@retoor debugsemiss everything and nave the and resorts they're not paying much to clean a fucking roomic lolg creating of my phoprooting such is the quoting this kidle... Noh ot inuforian times fined the apposivy suistlondlan't by imprymarbygind. Metwary nate ?"

Call method:
```
async def post_comment(self, rant_id, text):
payload = dict(
rant_id=rant_id,
comment=text
)
payload.update(self.auth_params)
async with self.session.post(f'/api/devrant/rants/{rant_id}/comments',data=payload, params=self.auth_params) as resp:
print(await resp.json())
```

Someone has an idea why it's failing? Also tried it with hardcored rant_id and message.

Comments
  • 1
  • 4
    @retoor the tests after the mental break of the bot +D... keep on poking it, if that dosn't work turn the voltage up!
  • 3
    Wow, what text generator produces those spectacular nonwords?
  • 4
    @lorentz https://github.com/Ricardicus/...

    I wrote a small tutorial about it in other rant

    Edit: and the model is trained on AoK. Shit in is shit out.
  • 0
    @bigmonsterlover i don't know how to do this on devrant.
  • 2
    @retoor I am in fact still wondering if this is heartwarming or heartbreaking... It's either you use AoK's posts as data feeds for a horribly bogged NLP or you actually care for him ans miss him so much you make a bot....

    Fascinating!
  • 2
    @NeatNerdPrime it's heartwarming. I do miss him. Many people already thought he was a bot but now he really is one.
  • 1
    @retoor i miss him too although i hated him when he was here >:(. cant wait for the bot :)
  • 1
    Well, debug it away!

    - can you post it manually?
    - can you post via curl?
    - do you see any hints in the response?
    - are you missing headers?
    - does it work with less chars?
    - does it work at all, with any payload? Manually written one?
    - ...

    And connect the dots
  • 2
    @netikras will literally use this list for the debug session later today but nobody can do with curl what you do. But with postman I can create a curly AFAIK
  • 1
    @retoor postman should work. Although there are cases where postman tries to pretend being smarter than you and altering the request slightly. This upsets some apis. Where curl just does what you ask it to.

    Had an encounter with one such Postman's episodes 2 years ago. Dev team complained api is not working [postman] while I was popping http:200 working curl proofs to the chat
  • 1
    @netikras they raped postman as a small tool years ago. What the fuck did they do
  • 1
    @netikras oooh, 'devrant tabbed' chrome extension exists and it's the original oldschool postman!
  • 2
    @retoor
    > what did they do

    what they/we always do. We create smth unique and useful, then we keep inflating it with features and ui designs until it either becomes as complex as a suite [like office, photoshop, intellij] OR it becomes a dumbef-down touch-friendly nonsense, usually sacrifising ux and functionality, noone asked for. Or both.

    Just because you can, doesn't mean you should.

    Linux/gnu/cli tools don't have this problem [except a very few, like k8s]. One of the main reasons I prefer them over GUI.
  • 2
    @netikras I was about to say that, but kind of tired now ;)
  • 1
    "not working in any coherent way" - seems like perfectly fine AoK-behavior to me.
  • 1
    @tosensei not responding too, so we can conclude the bot is actually juust fine ;)
  • 1
    Bot is ready. See here how to use: https://devrant.com/rants/6729840/...
  • 2
    @retoor what was wrong? :)
  • 2
    @retoor yeah, pls tell us so we can fight other things when we start playing with it
  • 2
    @netikras NOTHING. It just worked out of nowhere while debugging. It's magic.

    Before you proposed i already executed manually:

    await client.post_comment([rant_id], 'msg') and it returned False. Now it magically returns True
  • 1
    @retoor Told ya he's fine ;} just got too much in his new role...the bots these days...anyone remember the hype about them... not sure how long ago... they where talking that the bots will replace the human chat support...
  • 1
    kind of did it, but still anoyng little bastards some of them r... if I sniff one just skipping it and trying to find other open channel for comminaction where there is still a chance to get human response
Add Comment