Giter Site home page Giter Site logo

bcdice-api's Introduction

BCDice

Action Status Gem Version YARD codecov Discord

様々なTRPGシステムの判定に対応したオンセツール用ダイスコマンドエンジン

Documents

バグ報告や機能要望

BCDiceの問題を発見したり、機能の要望がある時に起こすアクションの一例は以下のようなものがあります。

  1. Discordの BCDice Offcial Chat にある各種チャンネルへ投稿する (迷ったらここ!)
  2. Twitterで @ysakasin にメンションを送る
  3. 問い合わせフォームから問い合わせる
  4. GitHubの issue や Pull Request を作成する (GitとGitHubがわかる人向け)

Quick Start

require "bcdice"
require "bcdice/game_system" # 全ゲームシステムをロードする

cthulhu7th = BCDice.game_system_class("Cthulhu7th")
result = cthulhu7th.eval("CC<=25") #=> #<BCDice::Result>
result.text      #=> "(1D100<=25) ボーナス・ペナルティダイス[0] > 1 > 1 > クリティカル"
result.success?  #=> true
result.critical? #=> true
require "bcdice"
require "bcdice/user_defined_dice_table"

text = <<~TEXT
  飲み物表
  1D6
  1:水
  2:緑茶
  3:麦茶
  4:コーラ
  5:オレンジジュース
  6:選ばれし者の知的飲料
TEXT
result = BCDice::UserDefinedDiceTable.eval(text) #=> #<BCDice::Result>
result.text #=> "飲み物表(6) > 選ばれし者の知的飲料"

LICENSE

BSD 3-Clause License

bcdice-api's People

Contributors

blhsrwznrghfzpr avatar daicyan avatar dependabot[bot] avatar h-mikisato avatar koi-chan avatar kumakaba avatar nkmr6194 avatar ochaochaocha3 avatar ysakasin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bcdice-api's Issues

Setupの方法について、Readmeの更新提案

はじめまして。初issueゆえ拙い部分があると思われますが、ご指摘頂けると助かります。
まとめると、Readmeの
$ bundle exec rackup

$ bundle exec rackup -o 0.0.0.0
に差し替える提案についてです。

自宅のCentos7サーバにLAN内のWindows10マシンから遠隔で配置を試みまして、Setupの最後の部分で詰まっていました。
$ bundle exec rackup
この通りにコマンドを入力するとLAN内外問わず接続ができない状態でした。このとき他のサービスは通常通り使えています。
調べましたところ、このようなページがヒットしました。
sinatraでrackupからの起動でlocalhost以外からの接続を許可しようとしたらハマった件
このページの通りに先程のコマンドを
$ bundle exec rackup -o 0.0.0.0
と置き換えて実行したところ、無事LAN内外問わず動作していることを確認できました。
今はサービス化まで済ませています。
よろしくおねがいします。

不正なコマンドを受け取った際のエラーハンドリング

どどんとふ公式鯖で受け取っているDiceBotのかなりの数が、Command=部分に普通のチャットメッセージ等が挿入されていて、その際に「NoMethodError - undefined method `gsub' for nil:NilClass:」や「CommandError - CommandError:」のExceptionのログが大量に吐かれてしまいます。
API的には400を返して終わりなので利用者や開発者側から気がつくことなくサーバー側にかなりの量のログが溜まってしまうので、この部分のエラーをTRAPするようにする等はできないでしょうか?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.