Skip to content

Commit

Permalink
Added reposting
Browse files Browse the repository at this point in the history
  • Loading branch information
gamemake-eng committed Dec 10, 2023
1 parent 586e52c commit 6bda9bd
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ It has support for
## ToDo list!

- [X] Liking
- [ ] Reposting
- [X] Reposting
- [ ] Full screen message editor
- [ ] Media links
- [ ] Notifications
Expand Down
3 changes: 2 additions & 1 deletion mastoline/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@
hlp = Help()
about = About(codename, ver, art)
like = Like(mastodon)
reblog = Reblog(mastodon)

cmdline = CommandLine(mastodon.me().acct, "~>", [list, refresh, reply, like, toot, close, hlp, about], view)
cmdline = CommandLine(mastodon.me().acct, "~>", [list, refresh, reply, like, reblog, toot, close, hlp, about], view)

print("------------------------------------")
print(art)
Expand Down
16 changes: 16 additions & 0 deletions mastoline/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,22 @@ def run(self):
else:
print("[red]that's not a number![/red]")

class Reblog:
def __init__(self, mastodon):
self.m = mastodon

def run(self):
mastodon = self.m
rid = input("what is the the reply id of the post? ")
if rid.isnumeric():
conf = input("Are you sure? (y/n) ")
if conf[0] == "y":
mastodon.status_reblog(int(rid))
else:
print("ok")
else:
print("[red]that's not a number![/red]")

class Toot:
def __init__(self, mastodon):
self.m = mastodon
Expand Down

0 comments on commit 6bda9bd

Please sign in to comment.