mirror of
https://git.kiwifarms.net/mint/ebooks.git
synced 2024-10-23 00:39:05 +00:00
whatever
This commit is contained in:
parent
d140e34055
commit
5d61b6a5e6
1 changed files with 1 additions and 2 deletions
3
reply.py
3
reply.py
|
@ -11,8 +11,6 @@ def parse_args():
|
||||||
return utils.arg_parser_factory(description='Reply service. Leave running in the background.').parse_args()
|
return utils.arg_parser_factory(description='Reply service. Leave running in the background.').parse_args()
|
||||||
|
|
||||||
class ReplyBot:
|
class ReplyBot:
|
||||||
PAIRED_PUNCTUATION = re.compile(r"[{}]".format(re.escape('[](){}"‘’“”«»„')))
|
|
||||||
|
|
||||||
def __init__(self, cfg):
|
def __init__(self, cfg):
|
||||||
self.cfg = cfg
|
self.cfg = cfg
|
||||||
self.pleroma = pleroma.Pleroma(access_token=cfg['access_token'], api_base_url=cfg['site'])
|
self.pleroma = pleroma.Pleroma(access_token=cfg['access_token'], api_base_url=cfg['site'])
|
||||||
|
@ -71,6 +69,7 @@ class ReplyBot:
|
||||||
await self.pleroma.react(post_id, '✅')
|
await self.pleroma.react(post_id, '✅')
|
||||||
|
|
||||||
async def reply(self, notification):
|
async def reply(self, notification):
|
||||||
|
PAIRED_PUNCTUATION = re.compile(r"[{}]".format(re.escape('[](){}"‘’“”«»„')))
|
||||||
toot = await utils.make_post(self.cfg) # generate a toot
|
toot = await utils.make_post(self.cfg) # generate a toot
|
||||||
if self.cfg['strip_paired_punctuation']:
|
if self.cfg['strip_paired_punctuation']:
|
||||||
toot = PAIRED_PUNCTUATION.sub("", toot)
|
toot = PAIRED_PUNCTUATION.sub("", toot)
|
||||||
|
|
Loading…
Reference in a new issue