Skip to content

Instantly share code, notes, and snippets.

@kurgm
Last active November 19, 2022 07:07
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kurgm/9aeeda3709573f932b5a89cfe3a64c08 to your computer and use it in GitHub Desktop.
GlyphWiki更新通知ボットの使い方

GlyphWiki更新通知ボット(@GlyphWikiNotify)の使い方です。

このボットはグリフウィキ関連の非公式ボットです。何かあったら @kurgm(またはグリフウィキの 利用者-会話:twe)までお知らせください。

なお、当ボットのサービスは無保証とさせていただきます。 何らかのバグにより、返事がこなかったり通知が投稿されなかったり変な動作をしたりするかもしれません。ご了承ください。

2つの機能

このボットには機能が2つあります。

最近更新したページ」から最新の更新を4時間おきに取得して、

  1. 更新があれば更新内容を画像で投稿します。(ただし占有ページの更新は除く)
  2. あらかじめ指定したページの更新をリプライでお知らせします。

1.についてはこのボットをフォローすればタイムラインに更新情報が流れてくるということです。

2.(リプライ通知機能)を利用するには、あらかじめ、お知らせを受け取りたいページ(=グリフor文章)をウォッチリストに登録しておく必要があります(方法は次節にあります)。ウォッチリストに登録したページがグリフウィキ上で更新されると、原則4時間以内にボットがリプライでお知らせします。

なお、当botの利用にあたり、グリフウィキのアカウントは必要ありません。

リプライ通知機能の使い方

非公開アカウントならフォローする

リプライ通知機能を利用するには、非公開アカウントの場合はまず @GlyphWikiNotify をフォローしてください。原則4時間以内に自動でフォローリクエストしますので、承認してください。非公開アカウントでなければフォローの必要はありません。(が、フォローされればフォローバックはします。)

通知を受け取りたいページを登録

通知を受け取りたいページを登録するには、例えば次のようにリプライを送ってください。

  • @GlyphWikiNotify watch GlyphWiki:井戸端
    (文章「GlyphWiki:井戸端」の更新の通知を受け取るようになります)
  • @GlyphWikiNotify watch u9000
    (グリフ「u9000」の更新の通知を受け取るようになります)

(詳しい使い方は下にあります)

グリフウィキ上の更新を待つ

登録したページが更新されると4時間以内にリプライで通知されます。

どんな通知がきますか?

例:@*** さんがページ「利用者-会話:%%%」をウォッチリストに登録していて、そのページが変更された場合

@*** 利用者-会話:%%% が変更されました。

とお知らせします。また、更新の詳細な内容(グリフ画像・時刻・ユーザー・編集内容の要約などを含む)の画像を添付します。

詳しい使い方

全ての操作は当ボットへのリプライで行います。

@GlyphWikiNotify {コマンド} {引数…}
  • コマンドや引数を波括弧 { } でくくる必要はありません。以下の波括弧も同様。
  • コマンドの前後には空白文字が必要です。
  • @GlyphWikiNotify の前に文章があると反応しません。

現在以下のコマンドが利用できます。

watch

(「監視」「登録」「追加」「ウォッチ」も同じです)

ウォッチリストに 1 件追加します。複数件追加したい場合は 1 つずつ追加してください。

構文1

@GlyphWikiNotify watch {条件文}

ここで、{条件文} とは以下をそれぞれ最大1回空白で区切ってつなげたものです(順不同):

  • {ページ名} または /{ページ名の正規表現}/
    • {ページ名} はウォッチリストに追加するページ名です。これは完全一致です(例えば、u2163 をウォッチリストに追加しても u21631ノート:u2163 などの変更は通知しません)。
    • {ページ名} はその時点で存在していなくても構いません(作成されると通知します)。
    • {ページ名} が不正な場合はエラーが返信されます。
    • {ページ名の正規表現} を指定する場合、この正規表現がページ名にマッチするページが更新されると通知します。これは部分マッチです。ページ名全体にマッチさせたい場合は ^$ で囲ってください。
    • 名前空間が日本語のページ名(例えば、グループ:備忘録)と名前空間が英語のページ名(例えば、Group:備忘録)のいずれかにマッチすると通知します(/グループ:/としても/Group:/としてもよいということです)。
    • 正規表現には JavaScript の RegExp で利用できる構文が利用できます。
    • /{ページ名の正規表現}/i にすると大文字と小文字を区別しなくなります。
    • {ページ名の正規表現} の構文が不正な場合はエラーが返信されます。
    • {ページ名の正規表現} の構文さえ正しければ、どんなページ名にもマッチしえなくてもエラーにはならないので、注意してください。
    • -{ページ名}-/{ページ名の正規表現}/ とする(前にマイナスをつける)と、それにマッチしないページの変更が通知されます。
  • by:{ユーザー}
    • グリフウィキ利用者 {ユーザー} による更新を通知します。
    • {ユーザー} は複数のユーザーをカンマ , で区切って指定できます(例えば by:user1,user2)。カンマの後に空白文字を含めてはなりません。
    • _(アンダースコア)は特別なユーザー名で、匿名利用者を意味します。(すなわち by:_ とすれば匿名利用者による更新が通知されます。)
    • -by:{ユーザー} とする(前にマイナスをつける)と、それ以外の利用者による変更が通知されます。
  • summary:{編集内容の要約} または summary:"{編集内容の要約}" または summary:/{編集内容の要約の正規表現}/
    • 編集内容の要約が {編集内容の要約} に等しい更新を通知します。これは完全一致です。
    • {編集内容の要約} に空白文字を含めたい場合(や先頭の文字を /" としたい場合)は二重引用符 " で括った書式を使用する必要があります。この際、二重引用符内ではバックスラッシュ \ や二重引用符 " などは \\ \" のようにエスケープしなければなりません。
    • {編集内容の要約の正規表現} を指定する場合、この正規表現が編集内容の要約にマッチする更新が通知されます。これは部分マッチです。
    • 正規表現には JavaScript の RegExp で利用できる構文が利用できます。
    • /{編集内容の要約の正規表現}/i にすると大文字と小文字を区別しなくなります。
    • {編集内容の要約の正規表現} の構文が不正な場合はエラーが返信されます。
    • -summary:{…} とする(前にマイナスをつける)と、編集内容の要約にそれがマッチしない更新が通知されます。
  • is:new
    • ページが新規作成された場合にのみ通知します。
    • -is:new とする(前にマイナスをつける)と、既存ページが編集された場合にのみ通知します。
  • is:broken
    • グリフウィキ上で最新版のグリフ画像の生成に失敗している(赤色の×印になっている)グリフの更新を通知します。
    • -is:broken とする(前にマイナスを付ける)と、そうでないページの更新を通知します。

{条件文} で指定されたすべての条件に合致する更新のみが通知されます。

{条件文} がすでにウォッチリストに追加されている場合はエラーが返信されます。

使用例

  • @GlyphWikiNotify watch GlyphWiki:井戸端
    (文章「GlyphWiki:井戸端」をウォッチリストに追加します)
  • @GlyphWikiNotify watch u9000
    (グリフ「u9000」をウォッチリストに追加します)
  • @GlyphWikiNotify watch /^u2ff.-/
    (正規表現 ^u2ff.- をウォッチリストに追加します。IDSグリフの更新が通知されます)
  • @GlyphWikiNotify watch /talk:/i
    (正規表現 talk:(大文字と小文字を区別しない)をウォッチリストに追加します。すべてのノート・会話ページの更新が通知されます)
  • @GlyphWikiNotify watch /Talk:/ -summary:/ストレッチ境界設定/
    (ページ名に正規表現 Talk: がマッチするが、編集内容の要約に正規表現 ストレッチ境界設定 がマッチしない更新が通知されます)
  • @GlyphWikiNotify watch -/_/
     (正規表現 _ がマッチしないページ(すなわちユーザー占有ページ以外)の更新が通知されます)
  • @GlyphWikiNotify watch by:_ summary:/./
    (匿名利用者による、編集内容の要約に何か記入がある更新が通知されます)

構文2

@GlyphWikiNotify watch
  • 現在のウォッチリストの内容を一覧形式で返信します。

unwatch

(「停止」「解除」「削除」「アンウォッチ」も同じです)

ウォッチリストから削除します。

構文1

@GlyphWikiNotify unwatch
  • まずウォッチリストの内容が返信されます。そのリプライに解除したい番号(複数選択可。番号をスペースで区切る)を返信すると解除できます。

構文2

@GlyphWikiNotify unwatch {条件文}
  • {条件文} がウォッチリストにあれば解除します。なければエラーが返信されます。
  • {条件文} は登録時の条件文と等価である必要があります。
  • この構文では複数の条件文を同時に解除することはできません。1 つずつ解除するか構文 1 を利用してください。

使用例

  • @GlyphWikiNotify unwatch GlyphWiki:井戸端
    (文章「GlyphWiki:井戸端」をウォッチリストから削除します)
  • @GlyphWikiNotify unwatch u9000
    (グリフ「u9000」をウォッチリストから削除します)
  • @GlyphWikiNotify unwatch /^u2ff.-/
    (正規表現 ^u2ff.- をウォッチリストから削除します)
  • @GlyphWikiNotify unwatch /talk:/i
    (正規表現 talk: (大文字と小文字を区別しない)をウォッチリストから削除します)
  • @GlyphWikiNotify unwatch /Talk:/ -summary:/ストレッチ境界設定/
    (条件文 /Talk:/ -summary:/ストレッチ境界設定/ をウォッチリストから削除します)
  • @GlyphWikiNotify unwatch -/_/
    (条件文 -/_/ をウォッチリストから削除します)
  • @GlyphWikiNotify unwatch by:_ summary:/./
    (条件文 by:_ summary:/./ をウォッチリストから削除します)

ignore

(「無視」も同じです)

自分のグリフウィキユーザー名を指定します。ウォッチリストに追加したページが自分によって更新された場合、それ以前の更新は通知する必要が無いため無視します。

例えば自分のグリフウィキユーザー名が twe だったとします。u9000 をウォッチリストに追加していて、このページが次のように変更された場合:

@1000 user1
@1001 twe
@1002 user2

user1 と twe(自分)による更新は通知せず、user2 による更新だけを通知します。もしも user2 による更新が無かった場合は、このページに関しては通知されません。

構文

@GlyphWikiNotify ignore {ユーザー名}
  • 自分のグリフウィキユーザー名を {ユーザー名} に設定します。
  • {ユーザー名} が不正な場合はエラーが返信されます。
  • {ユーザー名} はカンマで区切って複数指定できます。
  • グリフウィキユーザー名の設定を解除したい場合は @GlyphWikiNotify ignore , としてください。

lang

(「言語」も同じです)

当ボットからの返信の言語を変更します。

構文

@GlyphWikiNotify lang {言語コード}
  • {言語コード} は今のところ ja(日本語), en(英語), zhs(中国語簡体字)のいずれかが有効です。

使用例

  • @GlyphWikiNotify lang en
    (ボットからの返信の言語を en(英語)に切り替えます)

注意

  • 「ボットの編集」と「自動編集」と「sandboxグリフ」は監視の対象外です(通知されません)。
  • 4時間ごとに取得・通知していますので、更新後すぐにお知らせがくるわけではありません。

This document explains how to use GlyphWikiNotify bot (@GlyphWikiNotify).

GlyphWikiNotify bot is an unofficial bot of GlyphWiki. If you have any trouble or suggestion or something, let me know via @kurgm (or User-talk:twe).

The services of this bot is not guaranteed. It may happen that the bot doesn't respond or doesn't notify changes, or does something strange due to some bug.

Features

GlyphWikiNotify bot has two features: it fetches recent changes from “Recent changes” every 4 hours and

  1. posts the image of the changes (excluding user-owned pages).
  2. notifies if the pages registered to the user's watchlist were changed.

For the former feature, you will see recent changes in your timeline if you follow GlyphWikiNotify bot.

To use the latter feature, you must register pages (= glyphs and documents) that you want to be notified of changes of to your watchlist in advance. The next section will explain how to register pages. When the pages you registered to your watchlist has been changed, GlyphWikiNotify will notify you by sending a reply.

You don't need to have a GlyphWiki account to use this bot.

Using the reply-notification feature

Follow the bot if you are protecting your tweets

If you are protecting your tweets, please follow @GlyphWikiNotify to use the reply-notification feature. It will send a follow request to you within 4 hours in principle, so please approve it.

If you are not protecting your tweets, you don't need to follow the bot (though if you follow the bot it will follow you back).

Register pages

To register pages that you want to be notified of changes of, send a reply like the following:

  • @GlyphWikiNotify watch GlyphWiki:井戸端
    (You will be notified of changes of the document “GlyphWiki:井戸端”)
  • @GlyphWikiNotify watch u9000
    (You will be notified of changes of the glyph “u9000”)

(Detailed explanations of the commands are below)

Wait for the changes on GlyphWiki

When the pages you have registered are changed, the bot will send a reply to you within 4 hours.

What does the reply look like?

Example: @*** registered the page “User-talk:%%%” in their watchlist. When that page has been changed, the bot will send a reply as follows (if the language is set to English):

@*** User-talk:%%% was changed.

An image showing the details of the change (including images of the glyph, time, author, summary of the change) will be attached.

Detailed explanations of commands

Every command is performed by replies to this bot.

@GlyphWikiNotify {command} {arguments…}
  • Do not put curly brackets { } around the command or the arguments. (The same hereinafter)
  • Spaces are required around the command.
  • If there are words before @GlyphWikiNotify, the bot will not regard that reply as a command.

Currently the following commands are available:

watch

Adds one item to the user's watchlist. To add multiple items, use this command one by one.

Syntax 1

@GlyphWikiNotify watch {condition}

where {condition} is a list of the following qualifiers separated by spaces. Each kind of qualifier can appear 0 or 1 time and in arbitrary order.

  • {page name} or /{regular expression of page name}/
    • {page name} is the name of the page to register to the watchlist. It tests an exact match (e.g. even if u2163 is added in the watchlist, the user will not be notified of changes of u21631 or Talk:u2163 or so).
    • A page can be added even if the page {page name} does not exist at the point of adding. (When that page was created, the bot will notify the user.)
    • An error will be replied if {page name} is invalid.
    • If {regular expression of page name} is specified, the bot will notify the user when the page whose name this regular expression matches was changed. This tests a partial match. Surround the expression with ^ and $ to match the whole page name.
    • The bot will notify the user if the expression matches either the Japanese-namespace page name (e.g. グループ:備忘録) or the English-namespace page name (e.g. Group:備忘録). (That is, /グループ:/ and /Group:/ are equivalent.)
    • Syntax of JavaScript's RegExp can be used in regular expressions.
    • /{regular expression of page name}/i ignores case.
    • An error will be replied if {regular expression of page name} has a syntax error.
    • Note that if {regular expression of page name} has no syntax error, no error will be replied even if it cannot match any page name.
    • -{page name} or -/{regular expression of page name}/ (preceded by a minus sign) means every page except the page it matches.
  • by:{user}
    • The bot will notify the user of changes by the GlyphWiki user {user}.
    • Multiple users can be specified in {user} separated by comma , (e.g. by:user1,user2). No spaces following a comma are allowed.
    • _ (underscore) is a special user name which means the anonymous user. (If by:_ is added, the user will be notified of changes by an anonymous user.)
    • -by:{user} (preceded by a minus sign) means changes by the other users.
  • summary:{edit summary}, summary:"{edit summary}" or summary:/{regular expression of edit summary}/
    • The bot will notify the user of changes whose edit summary is equal to {edit summary}. This tests an exact match.
    • If {edit summary} has a space character (or begins with / or "), it must be surrounded by double quotation marks ". Between the double quotation marks, backslashes \, double quotation marks " etc. must be escaped like \\ \".
    • If {regular expression of edit summary} is specified, the bot will notify the user of changes whose edit summary this regular expression matches. This tests a partial match.
    • Syntax of JavaScript's RegExp can be used in regular expressions.
    • /{regular expression of edit summary}/i ignores case.
    • An error will be replied if {regular expression of edit summary} has a syntax error.
    • -summary:{…} (preceded by a minus sign) means every change except changes whose edit summary it matches.
  • is:new
    • The bot will notify the user when a new page is created.
    • -is:new (preceded by a minus sign) means changes of existing pages.
  • is:broken
    • The bot will notify the user of changes of glyphs whose newest version’s image GlyphWiki failed to generate.
    • -is:broken (preceded by a minus sign) means the other changes.

The user will be notified of changes that satisfy all the quantifiers in {condition}.

An error will be replied if {condition} is already added in the user's watchlist.

Examples

  • @GlyphWikiNotify watch GlyphWiki:井戸端
    (Adds the document “GlyphWiki:井戸端” to the watchlist)
  • @GlyphWikiNotify watch u9000
    (Adds the glyph “u9000” to the watchlist)
  • @GlyphWikiNotify watch /^u2ff.-/
    (Adds the regular expression ^u2ff.- to the watchlist. The user will be notified when an IDS glyph is changed.)
  • @GlyphWikiNotify watch /talk:/i
    (Adds the regular expression talk: (ignore case) to the watchlist. The user will be notified when any talk page is changed.)
  • @GlyphWikiNotify watch /Talk:/ -summary:/ストレッチ境界設定/
    (The user will be notified when the regular expression Talk: matches the name of glyph changed and the regular expression ストレッチ境界設定 does not match the edit summary)
  • @GlyphWikiNotify watch -/_/
    (The user will be notified when the pages whose name the regular expression _ does not match (i.e. not user-owned pages) were changed)
  • @GlyphWikiNotify watch by:_ summary:/./
    (The user will be notified of changes by an anonymous user with a non-empty edit summary)

Syntax 2

@GlyphWikiNotify watch
  • The bot replies the user's current watchlist.

unwatch

Removes condition(s) from the user's watchlist.

Syntax 1

@GlyphWikiNotify unwatch
  • The bot replies the watchlist. In reply to it, specify the items to remove by numbers (separated by spaces).

Syntax 2

@GlyphWikiNotify unwatch {condition}
  • If {condition} exists in the watchlist, removes it. If not, an error will be replied.
  • {condition} must be equivalent to the registered condition.
  • In this syntax, multiple conditions cannot be removed at once. Remove one by one, or use the syntax 1.

Example

  • @GlyphWikiNotify unwatch GlyphWiki:井戸端
    (Removes the document “GlyphWiki:井戸端” from the watchlist)
  • @GlyphWikiNotify unwatch u9000
    (Removes the glyph “u9000” from the watchlist)
  • @GlyphWikiNotify unwatch /^u2ff.-/
    (Removes the regular expression ^u2ff.- from the watchlist)
  • @GlyphWikiNotify unwatch /talk:/i
    (Removes the regular expression talk: (ignore case) from the watchlist)
  • @GlyphWikiNotify unwatch /Talk:/ -summary:/ストレッチ境界設定/
    (Removes the condition /Talk:/ -summary:/ストレッチ境界設定/ from the watchlist.)
  • @GlyphWikiNotify unwatch -/_/
    (Removes the condition -/_/ from the watchlist)
  • @GlyphWikiNotify unwatch by:_ summary:/./
    (Removes the condition by:_ summary:/./ from the watchlist)

ignore

Specify the user's account name on GlyphWiki. If the page added in the watchlist was changed by the user themselves, the user does not need to be notified of the edits before their change (since they already know of the changes), so the bot will ignore those edits.

Let's say your GlyphWiki account name is twe. You added u9000 in your watchlist. When this page is changed as follows:

@1000 user1
@1001 twe
@1002 user2

you will not be notified of the changes by user1 and twe (you), but you will be notified of the change by user2. If there are not changes like the change by user2, you will not be notified of changes of this page.

Syntax

@GlyphWikiNotify ignore {user name}
  • Sets the user's GlyphWiki user name to {user name}.
  • An error will be replied if {user name} is invalid.
  • Multiple user name can be specified in {user name} by separating by commas.
  • @GlyphWikiNotify ignore , unsets the GlyphWiki account name.

lang

Changes the language of replies from this bot. The default language is Japanese.

Syntax

@GlyphWikiNotify lang {language code}
  • Currently, valid values of {language code} are ja (Japanese), en (English) and zhs (simplified Chinese).

Examples

  • @GlyphWikiNotify lang en
    (Changes the language of replies from this bot to en (English))

Note

  • Edits by bots, automatic edits, and edits of sandbox glyph are not covered in this bot. (You will not be notified of those edits.)
  • Since this bot fetches changes and notifies every 4 hours, there is a time lag between the edit and the notification.
@gwjjanggu
Copy link

Will there be a Chinese (简体/繁體) language for this bot?
Btw I will help translate.

@graphemecluster
Copy link

私も zht(中国語繁体字)の翻訳に協力したいです。よろしくお願いします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment