mirror of
https://tildegit.org/ben/sedbot
synced 2025-04-19 12:03:24 +00:00
join channels and identify after RPL_WELCOME
This commit is contained in:
parent
b0063db78e
commit
e336fdb008
28
sedbot.bash
28
sedbot.bash
@ -25,7 +25,7 @@ connect() {
|
|||||||
if (($?)); then
|
if (($?)); then
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
sendmsg USER "$LOGIN 8 *" "$REALNAME"
|
sendmsg USER "$LOGIN 0 *" "$REALNAME"
|
||||||
if (($?)); then
|
if (($?)); then
|
||||||
return $?
|
return $?
|
||||||
fi
|
fi
|
||||||
@ -36,14 +36,6 @@ connect() {
|
|||||||
sendmsg MODE "$NICK +B"
|
sendmsg MODE "$NICK +B"
|
||||||
if (($?)); then
|
if (($?)); then
|
||||||
return $?
|
return $?
|
||||||
fi
|
|
||||||
# log in to services account if we have configs
|
|
||||||
if [ -f account.ini ]; then
|
|
||||||
. account.ini
|
|
||||||
sendmsg SQUERY "NickServ IDENTIFY ${account} ${password}"
|
|
||||||
if (($?)); then
|
|
||||||
return $?
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -314,6 +306,21 @@ readloop() {
|
|||||||
cmd="$(parse_command "$line")"
|
cmd="$(parse_command "$line")"
|
||||||
|
|
||||||
case $cmd in
|
case $cmd in
|
||||||
|
001)
|
||||||
|
# log in to services account if we have configs
|
||||||
|
if [ -f account.ini ]; then
|
||||||
|
. account.ini
|
||||||
|
sendmsg SQUERY "NickServ IDENTIFY ${account} ${password}"
|
||||||
|
if (($?)); then
|
||||||
|
return $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
for ch in "${CHANNELS[@]}"; do
|
||||||
|
sendmsg JOIN "$ch"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
|
||||||
PING)
|
PING)
|
||||||
sendmsg PONG "$(parse_args "$line")" "$(parse_message "$line")"
|
sendmsg PONG "$(parse_args "$line")" "$(parse_message "$line")"
|
||||||
;;
|
;;
|
||||||
@ -406,9 +413,6 @@ main() {
|
|||||||
while :; do
|
while :; do
|
||||||
if connect; then
|
if connect; then
|
||||||
sleep "$SLEEP_JOIN"
|
sleep "$SLEEP_JOIN"
|
||||||
for ch in "${CHANNELS[@]}"; do
|
|
||||||
sendmsg JOIN "$ch"
|
|
||||||
done
|
|
||||||
readloop
|
readloop
|
||||||
fi
|
fi
|
||||||
echo 'reconnecting in 10 seconds...' >&2
|
echo 'reconnecting in 10 seconds...' >&2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user