Эта страница только для чтения. Вы можете посмотреть её исходный текст, но не можете его изменить. Сообщите администратору, если считаете, что это неправильно. ====== Пример: Простейший IRC-bot ====== Умеет отвечать на команду !test сообщение "Hello, World!" <file python ircbot.dino> use, "socket" use, "strings" server = "irc.libera.chat:6667" username = "EstintaxBot" channel = "#mapicom" socket:connect, server sock = returned append, "USER ", username append, returned, " * * :" append, returned, username append, returned, "\n" socket:write, sock, returned append, "NICK ", username append, returned, "\n" socket:write, sock, returned append, "JOIN ", channel append, returned, "\n" socket:write, sock, returned ::polling socket:read, sock input = returned print, input strings:split, input, " ", splitted if returned <= 1 jump, "polling" end if splitted[0] == "PING" append, "PONG ", splitted[1] append, returned, "\n" socket:write, sock, returned print, "Answered PING." elif splitted[1] == "PRIVMSG" strings:split, input, ":", msg_splitted if msg_splitted[2] == "!test" sendmsg, splitted[2], "Hello, World!" end end jump, "polling" <<sendmsg, channel, msg append, "PRIVMSG ", channel append, r_sendmsg, " :" append, r_sendmsg, msg append, r_sendmsg, "\n" print, r_sendmsg socket:write, sock, r_sendmsg >> </file>