diff --git a/kaybot.py b/kaybot.py index 1d4ecc4..8460b48 100755 --- a/kaybot.py +++ b/kaybot.py @@ -4,6 +4,7 @@ from pleroma_bot import PleromaBot from mastodon import Mastodon from pathlib import Path import qtoml as toml +import urllib.parse with open('config.toml') as f: config = toml.load(f) @@ -18,13 +19,25 @@ def ping(notif, *_): pastas = {p.stem: p.read_text() for p in Path('pasta').glob('*.txt')} +home_instance = urllib.parse.urlparse(config['creds']['api_base_url']).netloc +def get_instance(fqn): + username, at, instance = fqn.partition('@') + if not at: + return home_instance + return instance + @bot.command def pasta(notif, pasta_name='', *_): """Pulls up a copypasta. Run with no arguments to get a list of available copypastas.""" if not pasta_name: pleroma.status_reply(notif['status'], f'Available copypasta: {", ".join(pastas)}') else: - pleroma.status_reply(notif['status'], pastas[pasta_name]) + acc = notif['status']['account'] + formatted = pastas[pasta_name].format( + username=acc['username'], + instance=get_instance(acc['acct']), + ) + pleroma.status_reply(notif['status'], formatted) if __name__ == '__main__': bot.run() diff --git a/pasta/dni.txt b/pasta/dni.txt new file mode 100644 index 0000000..b33702d --- /dev/null +++ b/pasta/dni.txt @@ -0,0 +1 @@ +Idk what's so hard to understand about this, but {instance} users do not fucking interact. I don't want to see your bullshit. I have "{instance} users dni" in my bio for a reason, jesus fucking christ. Any {instance} user that follows me will be blocked immediately, so act wisely. Yall are once again showing that you have no concept of littleboy.love. diff --git a/pasta/porn-and-hentai.txt b/pasta/porn-and-hentai.txt index 7df7045..327947f 100644 --- a/pasta/porn-and-hentai.txt +++ b/pasta/porn-and-hentai.txt @@ -1 +1 @@ -I fucking love porn and hentai, I spend everyday when I;m not at work masturbating, I want to see more porn and hentai and I want it to fill me entire day. I know freak.university is filled with some of the most depraved people on the internet and I want in on it, please! +I fucking love porn and hentai, I spend everyday when I;m not at work masturbating, I want to see more porn and hentai and I want it to fill me entire day. I know {instance} is filled with some of the most depraved people on the internet and I want in on it, please!