Global Feed Post Login
Replying to Avatar S!ayer

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.

86
8681369f... 1y ago

llms may not be very good at nostr

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

Reply to this note

Please Login to reply.

Discussion

Avatar
S!ayer 1y ago

TY.

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

Thread collapsed