Giter VIP home page Giter VIP logo

sharoho-bot's Introduction

しゃろほー bot

しゃろほーであなたのDiscordサーバーのメンバーと競おう!

使い方

デフォルト接頭辞:&

しゃろほー

毎日23:59:00から00:00:59までのしゃろほーを計測します。

ランク

ユーザーのランクを表示します。

しゃろしゃろ

メッセージの送信時刻を表示します。

&set

リザルトを送信するチャンネルに設定します。

&remove

リザルトチャンネルから除外します。

&help

ヘルプを表示します。

&about

bot情報を表示します。

設定

設定は.envファイルで行います。

TOKEN="Discord botトークン"
PREFIX="&"

データ構造

プレイヤーデータ

id name win part rating record best last
ユーザーID ユーザー名 優勝回数 参加回数 現在のレート 参加記録 最高記録(hh:mm:ss.fff) 最終参加日時
string string int int int json string string

record内構造:

[
    {
        "date": "日付(YYYY/MM/DD hh:mm:ss)",
        "rate": "レート"
    },
]

サーバーデータ

key guild
guild リザルト対応配列
string json

guild内構造:

[
    {
        "guild": "サーバーID",
        "channel": "チャンネルID"
    },
]

レート計算

Diffは23:59の場合は60と現在秒の差、00:00の場合は現在秒を表します。 Partは参加回数です。 レート計算の関数が良くないので誰か良い案を考えてほしい

初回参加時

$$ Rate = \left[ \frac{6200}{Diff + 2.1} \right] $$

2回目以降

$$ Rate = \left[ \frac{6000 + Part}{Diff + 1.98} \right] $$

画像処理

ランク

graph LR
    A["Sequelize"] --> B["Vega-Lite(SVG)"] --> C["svg-to-img(PNG)"] --> D["Discord"]
Loading

リザルト

graph LR
    A["Sequelize"] --> B["node-html-to-image(PNG)"] --> C["Discord"]
Loading

Q&A

Q: SequelizeのDATE型を使わないんですか?
A: 変えるのが面倒くさい

Q: SQLite以外のサポートを予定してますか?
A: 今後対応予定

Q: ファイル分割した方がメンテしやすくないですか?
A: ワイトもそう思います

Q: SequelizeとEnmap分ける意味ありました?
A: あったのかもしれない

sharoho-bot's People

Contributors

opera7133 avatar dependabot[bot] avatar

Stargazers

えるもあ avatar

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.