Giter Site home page Giter Site logo

decomoji's Introduction

decomoji v5

「デコモジ(decomoji)」は Slack のリアクション機能で使える最強カスタム絵文字セットです。このプロジェクトではそれら一つ一つを「デコモジ」と呼んでいます。

デコモジ v5 の基本セットの一覧画像

デコモジの特徴

🎨カラフルなテキスト画像
見やすい 12 のカラーパレットで Slack に彩を添えます!
🌓ダークモード対応
調整を重ねたカラーパレットで背景が暗くてもデコモジなら見えます!
🍱職人による割中レイアウト
2 行取りを基本に、文字数が多いものは 3 〜 5 行でレイアウトしました!
📦圧倒的な物量
まさに数の暴力! 全体で 20000 個あるデコモジなら使いたいリアクションが必ず見つかります!
🤖登録と削除の自動化スクリプト
膨大なデコモジもコマンドラインから自動でインストールできます!

デコモジはテキストを書き込んだ画像ファイルです。略語、字詰め、ワクワク感にこだわりました。

ハイコンテキスト! だから使って楽しい!

デコモジはあなたのワークスペースにカルチャーとベロシティを提供します!

Slack の発言にデコモジでリアクションをした様子。楽しそう!

まずは基本セットから始めましょう

デコモジには 3 つのカテゴリがあります。まずは基本セットの 300 個をあなたのワークスペースに登録してしばらく使ってみてください。

物足りなさを感じたら拡張セットも登録しましょう。Slack がもっと楽しくなります!

デコモジ一覧は下記ドキュメントで確認できますが、リンク先のドキュメントにアクセスすると超大量に画像ファイルを通信するのでご注意ください。

  • 基本セット: すぐに使えて Slack が楽しくなるセットです。
  • 拡張セット: 基本セットと合わせるとさらに Slack が便利で楽しくなるセットです。
  • 露骨セット: 性的なもの、暴力的なもの、露骨な表現で使用には注意が必要なものを隔離したセットです。多くの場合、使わない方が良いです。

デコモジを探す

「この言葉ってデコモジにあったっけ?」デコモジが多すぎでわからなくなりますよね。

そんな時はデコモジファインダーを使ってみてください。正規表現でも検索できます!

デコモジファインダーで「tarou」を含むデコモジを検索した様子。いっぱいあるね!

ワークスペースへの登録方法

カスタム絵文字の登録・削除には権限が必要です。

デコモジをあなたのワークスペースに登録する方法は 3 つあります。

  1. 絵文字登録ページのフォームから一つずつ登録する
  2. Chrome 用のエクステンション Slack Custom Emoji Manager で Drag&Drop で登録する
  3. スクリプトでコマンドラインから一括登録・削除する

次のセクションで 3 つ目の方法について解説しています。

スクリプトでコマンドラインから一括登録・削除する

この操作はエンジニア向けです。実行には Node.js v18.16.0 が必要です。

プロジェクトルートで依存パッケージをインストールしてからターミナル等で Node コマンドを実行してください。

git clone [email protected]:decomoji/decomoji.git
cd decomoji
npm ci
node scripts/manager/index.mjs

スクリプトでできること

  • 基本処理モードの選択
    • 追加
    • 削除
    • エイリアス登録
    • v4 から v5 への以降
    • v5 最新版への更新
  • 処理する対象タイプの選択
    • カテゴリーごと(基本セット、拡張セット、露骨セット)
    • バージョンごと(v5.x.y ごとにそれぞれ選択可能)
  • 処理の強さの選択(削除、移行、更新の場合のみ)
    • 強(権限の限り対象を削除する)
    • 弱(自分が追加したデコモジのみ削除する)

対話式でワークスペース、アカウント、パスワード、登録か削除、対象タイプを入力すると、自動で処理が始まります。

2FA ログインを利用している場合は数時間かかる可能性があります。できれば 2FA を解除してから実行してください。

v4 から v5 への移行

git pull でリポジトリを最新版にしてください。

「移行(v4 を v5 に置換)」モードを実行すると v4 のデコモジを v5 に置き換えるため、以下の処理を自動で行います。

  1. v4 時代の古いデコモジを全て削除する
  2. v5 の新しいデコモジを登録する
  3. 古いファイル名から新しいファイル名へのエイリアスを登録する

このモードでは基本セットと拡張セットが登録されます。v4 時代の露骨なデコモジは削除され、v5 の露骨セットは登録されません。

v5 の差分更新

最低でも v5.0.0 を登録済みのユーザー向けです。

git pull でリポジトリを最新版にしてください。

「更新」モードを実行すると以下の処理を自動で行います。

  1. v5.0.0 以降でミスあったデコモジを全て削除する
  2. 選択した対象タイプのデコモジを登録する
  3. v5.0.0 以降でファイル名の修正があったデコモジのエイリアスを登録する

選択した対象タイプによって動作が異なります。

  • 「カテゴリーごと」を選択した場合、カテゴリーに属する全てのデコモジを一括に処理します
  • 「バージョンごと」を選択した場合、選択したバージョンで修正、追加、ファイル名変更があったデコモジを抽出し、処理します

例えば、自分が v5.9.0 まで登録したことをわかっている場合は、対象タイプを「バージョンごと」にして、v5.9.1 以降を選択し、実行してください。

これにより v5.9.0 以前に修正、追加されたデコモジは処理しなくなり、カテゴリーを一括に処理するより高速です。

詳しくは実装を確認してください。

フー・ユーズ・デコモジ?

あなたの所属する組織のチームやコミュニティでデコモジが使われていたら、ぜひ「Who use decomoji?」リポジトリに追加して教えてください!

who-use-decomoji

サポートするには

Patreon で支援を受け付けています。

その他のドキュメント

スペシャルサンクス!

これらのデコモジは、imaz 氏が作成した:naruhodo:に影響を受け生み出されました。改めて深く感謝を申し上げます。

@imaz, @geckotang, @ginpei, @watilde, @matori, @fukayatsu, @maiha2, @webcre8, @masuP9, @yuheiy, @kubosho and All Contributors!

ライセンス

Copyright (c) 2015 decomoji consortium and other contributors.

Under the MIT License.

decomoji's People

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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

decomoji's Issues

Readability for Slack dark mode

現在slack-reaction-decomojiでは全ての絵文字が背景透過・単色文字で作成されていますが、Slackのダークモードではかなり読みにくくなる(特に黒に近い色の絵文字)という現象を確認しております。

以下は視認性を改善するためのアイディアです:

  • 全ての絵文字に背景を設定する
  • 縁取りを行う

decomoji? dekomozi?

プロダクト名は decomoji です。

アセットのファイル名はNOTATIONS.mdにより dekomozi です。

プロダクト名が dekomozi と表記されていたら間違いですし、「デコモジ」を含んだ画像のファイル名が decomoji になっていたら間違いです。

よろしくお願いいたします。

追加コマンドがループして完了しない

1/2795: skipped(already exists). _1.
2/2795: skipped(international emoji set already includes). sake.
3/2795: skipped(already exists). suuzisyouri.
4/2795: skipped(already exists). suwaro.
5/2795: skipped(already exists). suyasuya.
...略...
107/2795: skipped(already exists). syouninnyokkyuu.
108/2795: ratelimited syouraitekini.
Reconnecting...
1/2886: skipped(already exists). _1.
2/2886: skipped(international emoji set already includes). sake.
...略...

分母が変わっているのと、international emoji set already includes が出ているのはちょっとおいとく。

ratelimited エラーが出た後に追加しようとしているデコモジが _1, sake... とループしている。

error_name_taken エラーが出るまでの間、デコモジリストのインデックスがインクリメントされないので、ログインし直した後もリストの頭から追加リクエストをかけて error_name_taken エラーになり続ける、という状況の模様。

↑嘘だった。ちゃんとインクリメントはしている。ワークスペースに存在するカスタム絵文字リストと、ローカルのデコモジリストを突合させて、アップロード可能なリストにしているはずが、重複するアイテムが存在しているのが問題か。

登録時に TimeoutError が発生する

はじめに

Issue作成した後に、自己解決しました 🙇
実施したことを記載してCloseしておきます。

発生していたエラー

❯ node scripts/manager
? ワークスペースのサブドメインを入力してください: *****
? メールアドレスを入力してください: *****@*****
? パスワードを入力してください: **********
? モードを選択してください: 登録
? 対象タイプを選択してください: カテゴリーごと
? カテゴリーを選択してください: 基本セット, 拡張セット

workspace      : https://*****.slack.com/
email          : *****@*****
mode           : upload
updateMode     : false
term           : category
configs        : v5_basic,v5_extra
forceRemove    : false

Connecting...

(node:10093) UnhandledPromiseRejectionWarning: TimeoutError: Navigation timeout of 30000 ms exceeded
    at /Users/daiking1756/decomoji/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
    at async FrameManager.waitForFrameNavigation (/Users/daiking1756/decomoji/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:127:23)
    at async Frame.waitForNavigation (/Users/daiking1756/decomoji/node_modules/puppeteer/lib/cjs/puppeteer/common/FrameManager.js:440:16)
    at async Page.waitForNavigation (/Users/daiking1756/decomoji/node_modules/puppeteer/lib/cjs/puppeteer/common/Page.js:829:16)
    at async Promise.all (index 1)
    at async goToEmojiPage (/Users/daiking1756/decomoji/scripts/manager/modules/goToEmojiPage.js:33:3)
    at async _upload (/Users/daiking1756/decomoji/scripts/manager/modules/uploader.js:65:14)
    at async uploader (/Users/daiking1756/decomoji/scripts/manager/modules/uploader.js:162:3)
    at async main (/Users/daiking1756/decomoji/scripts/manager/index.js:68:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10093) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10093) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

2FAを有効にしていた場合は、代わりに下記のエラーが発生していました。

TimeoutError: waiting for selector `#list_emoji_section` failed: timeout 30000ms exceeded

心理的安全なサブセット decomoji-safety がほしい

多種多様な人が同じ職場の中で働く中で、好意でいれた emoji も時に人を不快にすることがあるようです。
つかうコンテキストに依りますが、超ハイコンテキストなデコモジだからこそ理解できないまたは不快に感じる人がいてもおかしくないのかもしれません。

ということで安全なデコモジだけをまとめたサブセットをつくれば、この多種多様な人がいる中でも心理的安全を守りつつ超ハイコンテキストなコミュニケーションができるんじゃないかと考えました。

気になるなら base だけ使っとけ(#37) ですかね。
extra でも人を傷つけそうにないならつかいたい、つかいたいんだ)

Need uninstaller or migration tool

v4リリースおめでとうございます 🎉

現在、v3導入済み環境からv4へのアップデートを計画しているのですが、既存デコモジの色・フォント変更が含まれてるとのことで、一旦既存のデコモジを削除しようとしています。

そこで、アンインストーラー、または移行用のツールがあると便利かと考え、Issueを立てさせて頂きました。

また、アンインストーラーの実装方法としては以下が考えられます。

  • 指定したバージョンで登録されるemojiを全部削除
    • decomoji以外で登録したemojiが削除される可能性がある?
  • 指定したバージョンで登録されるemojiを一旦取得し、ファイルが同一か判断して削除
    • 該当するバージョンのファイルか、ハッシュ値を持っておく必要がある
    • 時間が掛かる

以上、ご検討頂ければ幸いです。

Node 16番台で動かない

指定されているNodeV14~ではnpmが同梱されていないため、NodeV16.16.0(最新LTS)で実行したところ、
npm ciまでは動作するが、nodeが実行できないという問題が発生しました。NodeV16~への対応を要望します。
よろしくお願いします
吐き出されたエラー(理解できませんでした)

'grep' �́A�Ք�R�}���h�܂��͊O���R�}���h�A
����\�ȃv���O�����܂��̓o�b�` �t�@�C���Ƃ��ĔF������Ă��܂���B
node:child_process:902
    throw err;
    ^

Error: Command failed: git tag --list | sort -V | grep -E ^v5
'grep' �́A�����R�}���h�܂��͊O���R�}���h�A
����\�ȃv���O�����܂��̓o�b�` �t�@�C���Ƃ��ĔF������Ă��܂���B

    at checkExecSyncError (node:child_process:828:11)
    at execSync (node:child_process:899:15)
    at getGitTagArray (C:\Users\2021007292\OneDrive - tokyoeducation\デスクトップ\decomoji\decomoji\scripts\utilities\getGitTagArray.js:9:24)
    at Object.<anonymous> (C:\Users\2021007292\OneDrive - tokyoeducation\デスクトップ\decomoji\decomoji\scripts\manager\modules\askInputs.js:79:29)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19) {
  status: 255,
  signal: null,
  output: [
    null,
    Buffer(0) [Uint8Array] [],
    Buffer(114) [Uint8Array] [
       39, 103, 114, 101, 112,  39,  32, 130, 205, 129,  65, 147,
      224, 149, 148, 131,  82, 131, 125, 131, 147, 131, 104, 130,
      220, 130, 189, 130, 205, 138,  79, 149, 148, 131,  82, 131,
      125, 131, 147, 131, 104, 129,  65,  13,  10, 145, 128, 141,
      236, 137, 194, 148,  92, 130, 200, 131, 118, 131, 141, 131,
       79, 131, 137, 131, 128, 130, 220, 130, 189, 130, 205, 131,
      111, 131,  98, 131,  96,  32, 131, 116, 131,  64, 131,  67,
      131, 139, 130, 198, 130, 181, 130, 196, 148,  70, 142, 175,
      130, 179, 130, 234,
      ... 14 more items
    ]
  ],
  pid: 9220,
  stdout: Buffer(0) [Uint8Array] [],
  stderr: Buffer(114) [Uint8Array] [
     39, 103, 114, 101, 112,  39,  32, 130, 205, 129,  65, 147,
    224, 149, 148, 131,  82, 131, 125, 131, 147, 131, 104, 130,
    220, 130, 189, 130, 205, 138,  79, 149, 148, 131,  82, 131,
    125, 131, 147, 131, 104, 129,  65,  13,  10, 145, 128, 141,
    236, 137, 194, 148,  92, 130, 200, 131, 118, 131, 141, 131,
     79, 131, 137, 131, 128, 130, 220, 130, 189, 130, 205, 131,
    111, 131,  98, 131,  96,  32, 131, 116, 131,  64, 131,  67,
    131, 139, 130, 198, 130, 181, 130, 196, 148,  70, 142, 175,
    130, 179, 130, 234,
    ... 14 more items
  ]
}

M1チップ搭載のMacでスクリプト実行時にpuppeteer関係のエラーが出る

お世話になっております。
こちらのガイドライン拝見しました。

M1チップ搭載のMacでスクリプトを実行しようとしたところエラーが起き、解決しましたのでissueを立てさせていただきました。
プルリクエストも作成してみましたので、お手数ですが、ご確認お願いします。

npm ci

実行結果

error path-to-project/node_modules/puppeteer: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: path-to-project/node_modules/puppeteer
Output:
The chromium binary is not available for arm64:
If you are on Ubuntu, you can install with:

 apt-get install chromium-browser

path-to-project/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserFetcher.js:112
            throw new Error();

このようなエラーが出ました。

解決策

  1. .zshrcに以下を追加
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
export PUPPETEER_EXECUTABLE_PATH=`which chromium`
  1. 以下のファイルに追記
    decomoji/scripts/manager/modules/pretender.js
    decomoji/scripts/manager/modules/remover.js
    decomoji/scripts/manager/modules/uploader.js
    // puppeteer でブラウザを起動する
    const browser = await puppeteer.launch({
      executablePath: '/opt/homebrew/bin/chromium', // ここを追記しました
      devtools: BROWSER,
    });

再度、npm cinode scripts/managerで問題なく実行できました。

参考URL1
参考URL2

Net::HTTPTooManyRequests

import_extra.rb実行時に Net::HTTPTooManyRequests が出る場合があるようです。適宜ウェイトを挟む必要があるかもしれません。

.
.
.
importing zigokukayo...
importing mekarauroko...
importing donokyaraerabimasuka...
Traceback (most recent call last):
        7: from import_extra.rb:87:in `<main>'
        6: from import_extra.rb:15:in `import_decomojis'
        5: from import_extra.rb:55:in `upload_decomojis'
        4: from import_extra.rb:55:in `each'
        3: from import_extra.rb:69:in `block in upload_decomojis'
        2: from /usr/lib/ruby/gems/2.5.0/gems/mechanize-2.7.5/lib/mechanize.rb:536:in `post'
        1: from /usr/lib/ruby/gems/2.5.0/gems/mechanize-2.7.5/lib/mechanize.rb:1323:in `post_form'
/usr/lib/ruby/gems/2.5.0/gems/mechanize-2.7.5/lib/mechanize/http/agent.rb:323:in `fetch': 429 => Net::HTTPTooManyRequests for https://....slack.com/api/emoji.add -- unhandled response (Mechanize::ResponseCodeError)

Contributing Guidelines ?

How do I create decomoji?
I'd like to know about the guidelines for decomoji.

  • font name
  • width and height of an image
  • image file format

識別子が重複しているdecomojiが存在した場合にスクリプトが停止してしまう

すでにdecomojiが登録されているワークスペースにおいて, decomoji一括登録スクリプトを走らせるた時に重複するdecomoji識別子がすでに存在していた場合スクリプトがクラッシュしてしまうようです...

1/5302: uploaded are.
2/5302: uploaded bennri.
3/5302: uploaded buzisibou.
4/5302: uploaded edited.
5/5302: uploaded fabyurasu.
6/5302: uploaded gannbare.
7/5302: uploaded gennkou.
8/5302: uploaded giruthi.
9/5302: uploaded gotidesu.
10/5302: uploaded hai-.
11/5302: uploaded haikonntekisuto.
12/5302: uploaded heisya.
13/5302: uploaded hennziari.
14/5302: uploaded hennzikita.
15/5302: uploaded hennzinasi.
16/5302: uploaded hidariuekakuninn.

(中略...)

47/5302: uploaded ohureko.
48/5302: uploaded onnsya.
49/5302: uploaded reibannnosanngurasu.
50/5302: uploaded sassi.
51/5302: uploaded sasugada.
52/5302: uploaded seyanngu.
53/5302: uploaded sokubukuma.
54/5302: uploaded sonntaku.
55/5302: uploaded sonokotobagakikitakatta.
56/5302: uploaded suko.
57/5302: uploaded syuuryou.
58/5302: uploaded tannome.
59/5302: error_name_taken tanonnda.
[ERROR]Upload failed.

ruby スクリプトでデコモジが登録できない人へ

2020年5月頭にSlackの仕様が変わって、ruby スクリプトでは自動追加ができなくなってしまいました。

自動化スクリプトを JavaScript で作り直したので、最新の master ブランチを git pull して手順書を参考に実行してみてください。

:hai: が利用できない

:hai: のみ、登録しようとすると「残念ながら、国際標準絵文字セットにはすでに hai という名前のものが含まれています。別の名前を試してみますか?」と返されて登録できない
b0d29eac6e4bdbdf9c023701222ff347
7ebd8a33962e3179ebab7ae360db984c

既存のデコモジから色インデックスを逆引きするスクリプト

作業用のアドホックなスクリプトだし、ソースに入れるのもアレかなと思ったので Issue 立ててメモっておきます。

対象のデコモジPNGファイルが入ってるディレクトリに以下のNode.jsスクリプトをぶち込んで実行するだけ。 png-js というPNGデコーダーを使ってます。

const fs = require('fs')
const PNG = require('png-js')

const files = fs.readdirSync('.')
const promises = files
  .filter(file => /\.png$/.test(file))
  .map(readColor)

Promise.all(promises).then(colors => {
  fs.writeFileSync('result.tsv', colors.map(([file, color]) => {
    file = file.replace(/\.png$/, '')
    return `${file}\t${color}`
  }).join('\n'))
})

const DecomojiColors_v5 = [
  'dd3b40', // 0
  'c05b2c', // 1
  '9f7e00', // 2
  '688200', // 3
  '008c22', // 4
  '008780', // 5
  '0081b1', // 6
  '477f9b', // 7
  '5d79aa', // 8
  'a156d2', // 9
  'd43892', // 10
  'a36969' // 11
]

function colorIndex(rgb) {
  const r = ('0' + rgb.r.toString(16)).slice(-2)
  const g = ('0' + rgb.g.toString(16)).slice(-2)
  const b = ('0' + rgb.b.toString(16)).slice(-2)
  return DecomojiColors_v5.indexOf(`${r}${g}${b}`)
}

function readColor(file) {
  return new Promise(resolve => {
    PNG.decode(file, function (buffer) {
      let color
      for (let i = 0; i < buffer.length; i += 4) {
        const r = buffer[i]
        const g = buffer[i + 1]
        const b = buffer[i + 2]
        const a = buffer[i + 3]
        if (a === 255) {
          color = {r, g, b}
          break
        }
      }
      const index = colorIndex(color)
      if (index < 0) {
        resolve([file, `★★★ ${JSON.stringify(color)} ★★★`])
      } else {
        resolve([file, index])
      }
    })
  })
}

「ふ」が「fu」になっているものがある

目当てのデコモジがあるか探しているなか見つけたのですが、

台風接近
(https://github.com/decomoji/decomoji/blob/v5.19.1/decomoji/extra/taifuusekkinn.png)

このファイル名が "taifuusekkinn" となっておりました。命名規則を見るに、"taihuusekkinn" となるかと思いますがいかがでしょうか。

また、

フィフー
(https://github.com/decomoji/decomoji/blob/v5.19.1/decomoji/extra/fifu-.png)

も "fifu-" となっていました。

どちらも固有名詞でしたらすみません。

スクリプトを使って登録するときに、登録するデコモジを絞り込めるようにしたい

たとえば悪口系( butayarou.pngkuso.png)や、エロ系(gazoutikanu.pngoppai.png)など、Slackのグループによっては登録するのに躊躇してしまうデコモジがあるため、何らかの手段でインポートするデコモジを絞り込めると良さそうと思いました。

発生しそうな作業の一覧

UnhandledPromiseRejectionWarning で止まる

UnhandledPromiseRejectionWarning でプロセスが停止する現象を確認している。発生条件がいくつかあるもよう。

オブジェクトのプロパティを引き当てられなかったとき:

Register "v5.17.0" starting...
(node:21330) UnhandledPromiseRejectionWarning: TypeError: Cannot destructure property 'name' of 'localDecomojiList[i]' as it is undefined.
    at _pretend (/Users/hoge/decomoji/decomoji/scripts/manager/modules/pretender.js:52:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async pretender (/Users/hoge/decomoji/decomoji/scripts/manager/modules/pretender.js:122:3)
    at async main (/Users/hoge/decomoji/decomoji/scripts/manager/index.js:100:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:21330) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:21330) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

goToEmojiPage() を実行するも目的のページに到達できなかったとき:

(node:23145) UnhandledPromiseRejectionWarning: Error: Navigation failed because browser has disconnected!
    at CDPSession.<anonymous> (/Users/hoge/decomoji/decomoji/node_modules/puppeteer/lib/LifecycleWatcher.js:45:131)
    at CDPSession.emit (events.js:315:20)
    at CDPSession._onClosed (/Users/hoge/decomoji/decomoji/node_modules/puppeteer/lib/Connection.js:181:14)
    at Connection._onClose (/Users/hoge/decomoji/decomoji/node_modules/puppeteer/lib/Connection.js:110:21)
    at WebSocket.<anonymous> (/Users/hoge/decomoji/decomoji/node_modules/puppeteer/lib/WebSocketTransport.js:29:30)
    at WebSocket.onClose (/Users/hoge/decomoji/decomoji/node_modules/ws/lib/event-target.js:129:16)
    at WebSocket.emit (events.js:315:20)
    at WebSocket.emitClose (/Users/hoge/decomoji/decomoji/node_modules/ws/lib/websocket.js:191:10)
    at Socket.socketOnClose (/Users/hoge/decomoji/decomoji/node_modules/ws/lib/websocket.js:858:15)
    at Socket.emit (events.js:315:20)
  -- ASYNC --
    at Frame.<anonymous> (/Users/hoge/decomoji/decomoji/node_modules/puppeteer/lib/helper.js:94:19)
    at Page.goto (/Users/hoge/decomoji/decomoji/node_modules/puppeteer/lib/Page.js:485:53)
    at Page.<anonymous> (/Users/hoge/decomoji/decomoji/node_modules/puppeteer/lib/helper.js:95:27)
    at goToEmojiPage (/Users/hoge/decomoji/decomoji/scripts/manager/modules/goToEmojiPage.js:10:14)
    at _pretend (/Users/hoge/decomoji/decomoji/scripts/manager/modules/pretender.js:38:20)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async pretender (/Users/hoge/decomoji/decomoji/scripts/manager/modules/pretender.js:122:3)
    at async main (/Users/hoge/decomoji/decomoji/scripts/manager/index.js:60:7)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:23145) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23145) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

謎:

(node:23336) UnhandledPromiseRejectionWarning: #<ErrorEvent>
(Use `node --trace-warnings ...` to show where the warning was created)
(node:23336) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:23336) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

これらは、追加・削除・エイリアス登録・移行・更新の全ての実行モードで発生するが、発生せずプロセスが完了することもある。

「EUC_JP」という表記

画像:v5のEUC_JPというデコモジ
https://github.com/decomoji/decomoji/blob/v5.0.0/decomoji/extra/euc_jp.png

このデコモジがあったのを先ほど知りました。
ただ、連想するエンコーディングの表記は「EUC-JP」なので、違和感があります。

https://ja.wikipedia.org/wiki/EUC-JP

Encoding仕様でも、アンダースコアのほうはラベルとして登録されていません。
https://encoding.spec.whatwg.org/#ref-for-euc-jp
(Shift_JISはハイフンのやつもラベルとして認識されるらしいですが)

Import error

On import, I got error as below:

importing kannzenndoui...
Traceback (most recent call last):
        4: from import.rb:69:in `<main>'
        3: from import.rb:14:in `import_decomojis'
        2: from import.rb:52:in `upload_decomojis'
        1: from import.rb:52:in `each'
import.rb:61:in `block in upload_decomojis': undefined method `[]=' for nil:NilClass (NoMethodError)

note: I've already imported with older version (v4.x?) of decomoji on that Slack team which error occurred.

スクリプトが動かない

masterブランチで

cd script
bundle exec ruby import.rb

を実行すると、

Traceback (most recent call last):
	5: from import.rb:8:in `<main>'
	4: from /Users/oti/Sandbox/decomoji/decomoji/scripts/importer.rb:14:in `import_decomojis'
	3: from /Users/oti/Sandbox/decomoji/decomoji/scripts/importer.rb:53:in `move_to_emoji_page'
	2: from /Users/oti/Sandbox/decomoji/decomoji/scripts/importer.rb:53:in `loop'
	1: from /Users/oti/Sandbox/decomoji/decomoji/scripts/importer.rb:59:in `block in move_to_emoji_page'
/Users/oti/Sandbox/slack-reaction-decomoji/decomoji/scripts/importer.rb:40:in `login': undefined method `email=' for nil:NilClass (NoMethodError)

というエラーが返ってきてデコモジの追加が行えません。

おそらくですが、Slack本体がログイン画面を動的なHTMLで構築するように変更したため、ログインページのURLを Mechanize でアクセスして返却されたHTMLには <form> 要素が含まれなくなり、ログイン処理が行えないという状況のようです。

ログインページが動的HTMLになった以上、Mechanize 利用のままでは対応できない気がします。Ruby はまともに学習したことがないのでこれに対処するコードを私が書ける自信がありません。

誰か助けてくださると幸いです。

2要素認証を利用しているとログインに失敗して自動スクリプトが実行できない

v5.26 で確認。

Slackのアカウントで 2 要素認証を利用していると、自動スクリプトを実行して 2FA コードを入力しても下記エラーが出て処理が進まないバグを確認しています。

? 2FA コードを入力してください: ******
file:///Users/***/***/decomoji/node_modules/puppeteer-core/lib/esm/puppeteer/common/WaitTask.js:69
                void this.terminate(new TimeoutError(`Waiting failed: ${options.timeout}ms exceeded`));
                                    ^

TimeoutError: Waiting for selector `#list_emoji_section` failed: Waiting failed: 30000ms exceeded
    at Timeout.<anonymous> (file:///Users/***/***/decomoji/node_modules/puppeteer-core/lib/esm/puppeteer/common/WaitTask.js:69:37)
    at listOnTimeout (node:internal/timers:569:17)
    at process.processTimers (node:internal/timers:512:7)

Slack 側のインターフェースが以前と変更されたのが原因なので、v5.27 で修正予定です。もうしばらくお待ちください。

v5.22.0 で scripts/manager/index.js がタイムアウトする

いくつかのワークスペース・アカウントで試しましたが同じ結果でした。

(node:7658) UnhandledPromiseRejectionWarning: TimeoutError: waiting for selector `#list_emoji_section` failed: timeout 30000ms exceeded

-d オプションをつけて実行すると、chromium v91 がサポート外であるメッセージが表示されます。

スクリーンショット 2023-05-11 21 26 18

Node.js v14 が EOL になったこともあり、Node.js を v18 に上げつつ、puppeteer 含む依存パッケージを更新して対応しようとお見ます。

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.