aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Laprade <jesselaprade@gmail.com>2021-03-24 09:41:46 -0400
committerJesse Laprade <jesselaprade@gmail.com>2021-03-24 09:41:46 -0400
commitfbd3c95752a0abf0453881f4e509cee793d4de03 (patch)
tree8883f7e8da6a73780d0792b69d20d2b331f84c48
parent7efb3e5d4878c79f61631880b284e08826c6f392 (diff)
downloadruth-fbd3c95752a0abf0453881f4e509cee793d4de03.tar.gz
ruth-fbd3c95752a0abf0453881f4e509cee793d4de03.tar.bz2
ruth-fbd3c95752a0abf0453881f4e509cee793d4de03.zip
changed let binding name
-rw-r--r--src/ruth.rkt30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ruth.rkt b/src/ruth.rkt
index 0e3e22a..4d72d96 100644
--- a/src/ruth.rkt
+++ b/src/ruth.rkt
@@ -176,31 +176,31 @@
;; Split message should look something like the following:
;; nick username channel message
;; :m455!m455@localhost PRIVMSG #tildetown :hmmm let me open up town's tmux
-(define (get-nickname split-server-message)
- (let* ([nickname-block (list-ref split-server-message 0)]
+(define (get-nickname split-server-data)
+ (let* ([nickname-block (list-ref split-server-data 0)]
[colon-removed (substring nickname-block 1)])
(string-trim colon-removed #px"(!.+)$")))
-(define (get-username split-server-message)
- (let* ([username-block (list-ref split-server-message 0)]
+(define (get-username split-server-data)
+ (let* ([username-block (list-ref split-server-data 0)]
[username-matches (regexp-match #rx"![~]?(.+)@" username-block)])
(list-ref username-matches 1)))
-(define (get-channel split-server-message)
- (list-ref split-server-message 2))
+(define (get-channel split-server-data)
+ (list-ref split-server-data 2))
-(define (get-message split-server-message)
- (let* ([first-word (list-ref split-server-message 3)]
+(define (get-message split-server-data)
+ (let* ([first-word (list-ref split-server-data 3)]
[colon-removed (substring first-word 1)])
- (cons colon-removed (list-tail split-server-message 4))))
+ (cons colon-removed (list-tail split-server-data 4))))
(define (commands-listen server-data-string)
- (let ([split-server-message (string-split server-data-string)])
- (when (equal? (list-ref split-server-message 1) "PRIVMSG")
- (let* ([nickname (get-nickname split-server-message)]
- [username (get-username split-server-message)]
- [channel (get-channel split-server-message)]
- [message-split (get-message split-server-message)]
+ (let ([split-server-data (string-split server-data-string)])
+ (when (equal? (list-ref split-server-data 1) "PRIVMSG")
+ (let* ([nickname (get-nickname split-server-data)]
+ [username (get-username split-server-data)]
+ [channel (get-channel split-server-data)]
+ [message-split (get-message split-server-data)]
[message-joined (string-join message-split)])
(match message-split
;; 2-item matches