Project

iris_ruby

0.0
No release in over 3 years
A Ruby package that supports the Iris framework
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

IrisRb

Iris 를 기반으로 루비로 포팅한 레포

설치

필요한것

Ruby 3.4.0 이상

사용법

gem install iris_ruby
ruby irisrb.rb

예제코드

require_relative 'lib/iris_rb/client'

def on_message(chat)
  if msg == ".hi"
    reply("Hello #{chat[:sender][:name]}")
  elsif msg == ".이미지"
    send_image(chat[:room][:id], "./image/example.jpg")
  end
end

def on_newmem(chat)
  reply("#{chat[:sender][:name]}님 환영합니다!")
end

def on_delmem(chat)
  reply("#{chat[:sender][:name]}님 안녕히 가세요!")
end

client = IrisRb::Client.new(
  url: "http://localhost:3000",
  hot_reload: true
)

sleep

나머지 문법은 Iris 문서를 참고해보세요

편의성 기능

Hot Reload

개발 중에는 hot_reload: true 옵션을 사용하여 파일 변경 시 자동으로 재시작할 수 있습니다:

client = IrisRb::Client.new(
  url: "http://localhost:3000",
  hot_reload: true
)

해당 디렉터리에서 .rb 확장자인 파일이 변경되면 자동으로 재시작됩니다.

버전

현재 버전: 0.0.1 (Discord)