bakape / shamichan

anonymous realtime imageboard focused on high performance and transparent moderation
Other
441 stars 75 forks source link

Bot-specific token #1056

Open Chiiruno opened 5 years ago

Chiiruno commented 5 years ago

This is something I've been interested in for a while, if I get my other project up and going, but anon had a cool idea so I figured I'd make an issue for this. Basically, in some cases, a bot for a board may be desirable for certain board-specific features whereas it would be bloat to incorporate server-side.

Idea:

This seems fairly fail-proof, but can you think of any possible (security, anti-spam) problems this may have. I might work on this, I might not, we'll see.

Chiiruno commented 5 years ago

This may also include board options such as names, or post IDs, in which the bot can ask the server to temporarily allow such only for that post

Chiiruno commented 5 years ago

Now that I think about it, we could also probably move #pyu and #roulette (and now #autobahn) to this method as well, but perhaps have them on the server itself rather than in the code, as these functions aren't really necessary, but are fun to have. Remove most of the server code, have the client have them via an optional "addon" that is able to be downloaded and enabled via the client options, so an optional client extension.

Chiiruno commented 5 years ago

This will result in some cleanup of client and server code, by moving these functions to that client "extension" and bot.

the8472 commented 5 years ago

I don't think commands can be implemented as pure clientside/bot type extensions. They're substitutions that happen synchronously at post submission.

Also, bots are not the same as client-extensions. That's conflating multiple things.

Chiiruno commented 5 years ago

I think you're misunderstanding something. There's two separate, but interlaced features I'm trying to push here.

  1. Giving bots the ability to bypass certain server regulations, with protections to assert no spam and no abuse.
  2. These bots may be able to have the ability to keep say a #pyu counter in their own database, and notify the server of the number on-change (which will be kept in memory instead of database), to make such things more generic and configurable, then that client interprets as #pyu (23232) or whatever. I haven't fully worked it out, and it will require bot-server cross communication. This will allow generic expansion of features though without bloating the server and client code.

I am not saying bots are client extensions, the two are separate, what I am saying is that the two can work together, and eliminate bloat, as well as massively expand features.

Chiiruno commented 5 years ago

As for the client extension part, now that I've thought on it a bit more, it may be possible to generalize it to the point that we can keep it in the client without the need for an "extension".

bakape commented 5 years ago

Fair enough. Get to it and we'll see as it progresses.

On Fri, 17 May 2019, 01:16 チルノ, notifications@github.com wrote:

As for the client extension part, now that I've thought on it a bit more, it may be possible to generalize it to the point that we can keep it in the client without the need for an "extension".

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bakape/meguca/issues/1056?email_source=notifications&email_token=AB347MH2HJ3MPL6AYU53ORTPVXMNTA5CNFSM4HNQP4QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVTGRPA#issuecomment-493250748, or mute the thread https://github.com/notifications/unsubscribe-auth/AB347MHPLJYQRCSLC2GS7YTPVXMNTANCNFSM4HNQP4QA .

zealousi commented 5 years ago

If I'm understanding correctly, this sort of refactoring would allow for something like #905 to be implemented in a /tg/ board-specific bot? So a board's operators could define any #commands by adding a bot that parses new posts for them and injectes output into the final post text?

bakape commented 5 years ago

Yes, assuming somebody actually writes it.

On Tue, 21 May 2019, 04:53 zealousi, notifications@github.com wrote:

If I'm understanding correctly, this sort of refactoring would allow for something like #905 https://github.com/bakape/meguca/issues/905 to be implemented in a /tg/ board-specific bot? So a board's operators could define any #commands by adding a bot that parses new posts for them and injectes output into the final post text?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bakape/meguca/issues/1056?email_source=notifications&email_token=AB347MA5XFYPWVMCML2MUQ3PWNIYNA5CNFSM4HNQP4QKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV2QT4I#issuecomment-494209521, or mute the thread https://github.com/notifications/unsubscribe-auth/AB347MHTVEHYDVUGXKYWO3DPWNIYNANCNFSM4HNQP4QA .

Chiiruno commented 5 years ago

It'd be a mid-scale refactor and rebuild, but yeah, it'll allow for quite a bit more too.