I have a question for nostr devs: say I want to create a bot, how do I then get it to post to nostr?

ChatGPT is telling me there's a nostrpy and I can import nostr into python?

e.g.

import time

import random

import nostr

# Initialize Nostr

nostr_client = nostr.Client(private_key="your_private_key")

# Example quotes

quotes = [

"Be yourself; everyone else is already taken. - Oscar Wilde",

"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. - Albert Einstein",

"So many books, so little time. - Frank Zappa"

]

def post_quote():

quote = random.choice(quotes)

nostr_client.send_message(quote)

# Run the bot

while True:

post_quote()

time.sleep(3600) # Post every hour

but I'm working blind here.

Reply to this note

Please Login to reply.

Discussion

llms may not be very good at nostr

https://github.com/jeffthibault/python-nostr

TY.

Not planning LLMs persay, but I do want to make a qoute bot

Haven't tried it myself yet, but I found this gm-bot-tutorial by nostr:npub1dergggklka99wwrs92yz8wdjs952h2ux2ha2ed598ngwu9w7a6fsh9xzpc that you might wanna check out.

https://dergigi.com/2023/01/19/how-to-build-a-nostr-gm-bot/