Skip to content

Instantly share code, notes, and snippets.

@backgr02
Last active September 3, 2023 16:00
Show Gist options
  • Save backgr02/fe678d83d512567f03ed9c3f1982fce8 to your computer and use it in GitHub Desktop.
Save backgr02/fe678d83d512567f03ed9c3f1982fce8 to your computer and use it in GitHub Desktop.
痒い時はタウンワーク
import json
from misskey import Misskey
def post(body: dict):
print("post")
print(json.dumps(body))
note = body['body']['note']
user = body['body']['note']['user']
if ("痒い" not in note.get('tags', [])):
return
# Input instance address (If leaved no attribute, it sets "misskey.io")
mk = Misskey(
address = "misskey.io",
i = "token", #FIXME: token
)
# Let's note!
mk.notes_create(
text = f"@{user['username']} そんな時は、タウンワーク!🐖",
reply_id = note['id'],
)
def lambda_handler(event, context):
print(json.dumps(event))
print(context)
body = json.loads(event['body'])
post(body)
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment