unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: David Thompson <dthompson2@worcester.edu>
To: guile-devel@gnu.org
Subject: Re: [ANN] guile-toxcore
Date: Fri, 12 Sep 2014 10:49:31 -0400	[thread overview]
Message-ID: <877g18uc5g.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <87a965t0i0.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me>

David Thompson <dthompson2@worcester.edu> writes:

> One of my goals with this project is to write a bot that users can add
> as a friend and use to test text/audio/video chat.  Currently, I have a
> working text chat echo bot.

Here's the config for the example client (examples/client.scm) that
provides the echo bot functionality:

  (use-modules (tox util))
  
  (define tox-bootstrap-nodes
    '(((ip . "192.254.75.98")
       (id . "951C88B7E75C867418ACDB5D273821372BB5BD652740BCDF623A4FA293E75D2F")
       (port . 33445)
       (ipv6? . #t))
      ((ip . "144.76.60.215")
       (id . "04119E835DF3E78BACF0F84235B300546AF8B936F035185E2A8E9E0A67C8924F")
       (port . 33445)
       (ipv6? . #t))
      ((ip . "23.226.230.47")
       (id . "A09162D68618E742FFBCA1C2C70385E6679604B2D80EA6E84AD0996A1AC8A074")
       (port . 33445)
       (ipv6? . #t))
      ((ip . "37.187.20.216")
       (id . "4FD54CFD426A338399767E56FD0F44F5E35FA8C38C8E87C8DC3FEAC0160F8E17")
       (port . 33445)
       (ipv6? . #t))
      ((ip . "54.199.139.199")
       (id . "7F9C31FE850E97CEFD4C4591DF93FC757C7C12549DDD55F8EEAECC34FE76C029")
       (port . 33445)
       (ipv6? . #f))
      ((ip . "37.59.102.176")
       (id . "B98A2CEAA6C6A2FADC2C3632D284318B60FE5375CCB41EFA081AB67F500C1B0B")
       (port . 33445)
       (ipv6? . #t))
      ((ip . "192.210.149.121")
       (id . "F404ABAA1C99A9D37D61AB54898F56793E1DEF8BD46B1038B9D822E8460FAB67")
       (port . 33445)
       (ipv6? . #f))
      ((ip . "37.187.46.132")
       (id . "5EB67C51D3FF5A9D528D242B669036ED2A30F8A60E674C45E7D43010CB2E1331")
       (port . 33445)
       (ipv6? . #t))))
  
  (define (tox-friend-names tox)
    (map (lambda (friend-number)
           (tox-friend-name tox friend-number))
         (tox-friend-list tox)))
  
  (set-tox-name tox "Tox Test Bot")
  (set-tox-status-message tox "Hanging around")
  
  (add-hook! tox-friend-request-hook
             (lambda (tox public-key message)
               (format #t
                       "Friend request:\nClient ID: ~a\nMessage: ~a\n\n"
                       (bytevector->hex-string public-key)
                       message)
  	     (tox-add-friend-no-request tox public-key)))
  
  (add-hook! tox-message-hook
             (lambda (tox friend message)
               (let ((name (tox-friend-name tox friend))
                     (response (format #f "I received the message: \"~a\""
                                       message)))
                 (format #t "~a says: ~a\n" name message)
                 (tox-send-message tox friend response))))

-- 
David Thompson
Web Developer - Free Software Foundation - http://fsf.org
GPG Key: 0FF1D807
Support the FSF: https://fsf.org/donate



      reply	other threads:[~2014-09-12 14:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-12 13:46 [ANN] guile-toxcore David Thompson
2014-09-12 14:49 ` David Thompson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877g18uc5g.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me \
    --to=dthompson2@worcester.edu \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).