<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
	<link rel="self" type="application/atom+xml" href="https://forum.eggheads.org/app.php/feed/topic/21558" />

	<title>egghelp/eggheads community</title>
	<subtitle>Discussion of eggdrop bots, shell accounts and tcl scripts.</subtitle>
	<link href="https://forum.eggheads.org/index.php" />
	<updated>2024-07-27T07:11:44-04:00</updated>

	<author><name><![CDATA[egghelp/eggheads community]]></name></author>
	<id>https://forum.eggheads.org/app.php/feed/topic/21558</id>

		<entry>
		<author><name><![CDATA[haferbrei]]></name></author>
		<updated>2024-07-27T07:11:44-04:00</updated>

		<published>2024-07-27T07:11:44-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112946#p112946</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112946#p112946"/>
		<title type="html"><![CDATA[Re: help chatGTP]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112946#p112946"><![CDATA[
It would be best if you could also post the init routine, how the eggdrop is addressed in the channel, and which eggdrop you are using.<p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12860">haferbrei</a> — Sat Jul 27, 2024 7:11 am</p><hr />
]]></content>
	</entry>
		<entry>
		<author><name><![CDATA[flink]]></name></author>
		<updated>2024-06-16T05:45:16-04:00</updated>

		<published>2024-06-16T05:45:16-04:00</published>
		<id>https://forum.eggheads.org/viewtopic.php?p=112871#p112871</id>
		<link href="https://forum.eggheads.org/viewtopic.php?p=112871#p112871"/>
		<title type="html"><![CDATA[help chatGTP]]></title>

		
		<content type="html" xml:base="https://forum.eggheads.org/viewtopic.php?p=112871#p112871"><![CDATA[
hello i would like if someone can review it and give a solution and that the eggdrop answer me in the room because i get this error in the party line:<br><div class="codebox"><p>Code: </p><pre><code> In handle_message proc with args: {hola bot que tal el tiempo}User's message: hola bot que tal el tiempo In sendMessage proc with message: holabot que tal el tiempo Tcl error [handle_message]: unexpected 'p' in TOP mode</code></pre></div><div class="codebox"><p>Code: </p><pre><code># Load the required packagespackage require jsonputlog "json Cargado Correctamente"# Define the ChatGPT API keyset apiKey "here your API Key"putlog "API key set"# Define the ChatGPT API URLset apiUrl "https://api.openai.com/v1/engines/davinci/completions"putlog "API URL set: $apiUrl"# Send a message to ChatGPT using curlproc sendMessage {message} {    global apiKey apiUrl    putlog "In sendMessage proc with message: $message"    # Construct the request body as a JSON string    set body [json::json2dict [dict create prompt $message temperature 0.7 max_tokens 1000]]    set body [string map {"\n" "\\n" "\t" "\\t" "\r" "\\r"} $body]    putlog "Request body JSON encoded: $body"    # Use curl to send the request    set command [list curl -s -X POST $apiUrl -H "Authorization: Bearer $apiKey" -H "Content-Type: application/json" -d $body]    putlog "Executing curl command: $command"    set response [eval exec $command]    putlog "HTTP response received: $response"    # Parse the response JSON    set json [json::json2dict $response]    putlog "Response JSON parsed: $json"    # Get the response text    if {[dict exists $json choices 0 text]} {        set text [dict get $json choices 0 text]        putlog "Response text extracted: $text"    } else {        set text "Error: [dict get $json error message]"        putlog "Error in response: $text"    }    # Return the response text    return $text}# Handle user messages using `bind pub` commandbind pub -|- * handle_messageputlog "Bind command set for handling messages"# Message handling procedureproc handle_message {nick uhost handle chan args} {    global apiKey    putlog "In handle_message proc with args: $args"    # Get the user's message    set message [join $args " "]    putlog "User's message: $message"    # Send the message to ChatGPT    set response [sendMessage $message]    putlog "Response from gtpchat: $response"    # Send the response back to the user    puthelp "privmsg $chan :$response"    putlog "Response sent to channel: $chan"}putlog "ChatGTP cargado"</code></pre></div><p>Statistics: Posted by <a href="https://forum.eggheads.org/memberlist.php?mode=viewprofile&amp;u=12899">flink</a> — Sun Jun 16, 2024 5:45 am</p><hr />
]]></content>
	</entry>
	</feed>
