gbf-raidfinder-parser
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

Build Status codecov npm version

Parser for Granblue Fantasy raid tweets.

Getting started

Installation

npm install gbf-raidfinder-parser

Usage

const tweetParser = require('gbf-raidfinder-parser');
 
const tweetText = `MVP AD3959A6 :参戦ID
参加者募集!
Lv75 セレスト・マグナ
https://t.co/abc123`;
let valid = tweetParser.isRaidTweet(tweetText);
console.log(valid);
// Outputs: true
let parsed = tweetParser.parse(tweetText); 
console.dir(parsed);
/* Outputs: RaidTweet {
  text: 'MVP AD3959A6 :参戦ID\n参加者募集!\nLv75 セレスト・マグナ\nhttps://t.co/abc123',
  image: 'https://t.co/abc123',
  boss:
   Boss {
     text: 'Lv75 セレスト・マグナ',
     language: 'jp',
     level: 75,
     name: 'セレスト・マグナ' },
  language: 'jp',
  raid: Raid { text: 'MVP AD3959A6 :参戦ID', code: 'AD3959A6', message: 'MVP' } } */
 
const randomTweet = 'random tweet';
valid = tweetParser.isRaidTweet(randomTweet);
console.log(valid);
// Outputs: false
parsed = tweetParser.parse(randomTweet);
// Throws: TypeError

License

MIT

Package Sidebar

Install

npm i gbf-raidfinder-parser

Weekly Downloads

4

Version

1.1.1

License

MIT

Unpacked Size

32.4 kB

Total Files

54

Last publish

Collaborators

  • frizz925