Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Allow us to change the content of a file! #97

Open
alf1e opened this issue Mar 21, 2021 · 4 comments
Open

[Feature] Allow us to change the content of a file! #97

alf1e opened this issue Mar 21, 2021 · 4 comments

Comments

@alf1e
Copy link

alf1e commented Mar 21, 2021

Allow us to change the content of a file through discord!

@Gorialis
Copy link
Owner

I'm... not actually sure how this would be implemented. I'm assuming that "changing the contents" of a file constitutes not entirely replacing it. It's hard to take any inspiration from existing text editors because most of them assume some form of context (in the form of cursor position), and Discord doesn't really have any.

A generally good yardstick for whether the implementation of a command makes any intuitive sense is whether it's painful to use on mobile. An implementation that is extremely awkward on mobile is generally just an awkward implementation in general - so with that in mind, creating an interface that would feel like it actually works on mobile seems close to an insurmountable task, with the amount of interactivity Discord gives you out of the gate.

It feels like a task that the newer bot integrations might be well suited to, but I have no personal interest in maintaining features that require verification (since it would mean it wouldn't be accessible to all users of Jishaku), and I doubt they will ever make their way into Jishaku by other means (because I don't plan on verifying and would be unable to personally audit them).

If you're just overwriting files, you could probably get away with jsk sh echo "..." > file or running jsk py to grab and download an attachment.

But if you're wanting some means to actually edit (not replace) files within Jishaku, then it'll require a lot more thought and discussion on how you're expecting such an interface to work.

@alf1e
Copy link
Author

alf1e commented Mar 30, 2021

@Gorialis What you could do is a user dose cat and gets the content then dose a command and just edit the info from the cat. Then that info overwrites the file.

@pythonmcpi
Copy link

pythonmcpi commented Nov 26, 2022

This is probably a stupid idea but I might try implementing the ed editor as a Feature. I doubt that it'll be merged but I can post it as a gist and link to it.

Edit: Looks like I have ~3k lines of c code to recreate, although I can probably reuse stuff from python's standard library like re for regexes.

@Gorialis
Copy link
Owner

There was an experiment I did at one point that would allow you to edit the contents of a file through a Modal. The character limit and usability concerns prevented it from really being useful in any serious context, though, so it never got in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants