From b287d961f3888f2fd430103f41d72b02f40a689c Mon Sep 17 00:00:00 2001 From: vulet Date: Thu, 14 Jan 2021 18:58:29 +0800 Subject: [PATCH] refactor(cmd): separate commands by functionality --- commands/{ => fediverse}/beg.js | 0 commands/{ => fediverse}/boo.js | 0 commands/{ => fediverse}/clap.js | 0 commands/{ => fediverse}/copy.js | 0 commands/{ => fediverse}/flood.js | 0 commands/{fren.js => fediverse/follow.js} | 0 commands/{ => fediverse}/media.js | 0 commands/{ => fediverse}/mordy.js | 0 commands/{ => fediverse}/notify.js | 0 commands/{ => fediverse}/pin.js | 0 commands/{plemara.js => fediverse/post.js} | 0 commands/{ => fediverse}/redact.js | 0 commands/{ => fediverse}/reply.js | 0 commands/{ => fediverse}/status.js | 0 commands/{ => fediverse}/tip.js | 0 commands/{unfren.js => fediverse/unfollow.js} | 0 commands/{ => fediverse}/unpin.js | 0 commands/help.js | 8 ++-- registrar.js | 38 +++++++++---------- 19 files changed, 23 insertions(+), 23 deletions(-) rename commands/{ => fediverse}/beg.js (100%) rename commands/{ => fediverse}/boo.js (100%) rename commands/{ => fediverse}/clap.js (100%) rename commands/{ => fediverse}/copy.js (100%) rename commands/{ => fediverse}/flood.js (100%) rename commands/{fren.js => fediverse/follow.js} (100%) rename commands/{ => fediverse}/media.js (100%) rename commands/{ => fediverse}/mordy.js (100%) rename commands/{ => fediverse}/notify.js (100%) rename commands/{ => fediverse}/pin.js (100%) rename commands/{plemara.js => fediverse/post.js} (100%) rename commands/{ => fediverse}/redact.js (100%) rename commands/{ => fediverse}/reply.js (100%) rename commands/{ => fediverse}/status.js (100%) rename commands/{ => fediverse}/tip.js (100%) rename commands/{unfren.js => fediverse/unfollow.js} (100%) rename commands/{ => fediverse}/unpin.js (100%) diff --git a/commands/beg.js b/commands/fediverse/beg.js similarity index 100% rename from commands/beg.js rename to commands/fediverse/beg.js diff --git a/commands/boo.js b/commands/fediverse/boo.js similarity index 100% rename from commands/boo.js rename to commands/fediverse/boo.js diff --git a/commands/clap.js b/commands/fediverse/clap.js similarity index 100% rename from commands/clap.js rename to commands/fediverse/clap.js diff --git a/commands/copy.js b/commands/fediverse/copy.js similarity index 100% rename from commands/copy.js rename to commands/fediverse/copy.js diff --git a/commands/flood.js b/commands/fediverse/flood.js similarity index 100% rename from commands/flood.js rename to commands/fediverse/flood.js diff --git a/commands/fren.js b/commands/fediverse/follow.js similarity index 100% rename from commands/fren.js rename to commands/fediverse/follow.js diff --git a/commands/media.js b/commands/fediverse/media.js similarity index 100% rename from commands/media.js rename to commands/fediverse/media.js diff --git a/commands/mordy.js b/commands/fediverse/mordy.js similarity index 100% rename from commands/mordy.js rename to commands/fediverse/mordy.js diff --git a/commands/notify.js b/commands/fediverse/notify.js similarity index 100% rename from commands/notify.js rename to commands/fediverse/notify.js diff --git a/commands/pin.js b/commands/fediverse/pin.js similarity index 100% rename from commands/pin.js rename to commands/fediverse/pin.js diff --git a/commands/plemara.js b/commands/fediverse/post.js similarity index 100% rename from commands/plemara.js rename to commands/fediverse/post.js diff --git a/commands/redact.js b/commands/fediverse/redact.js similarity index 100% rename from commands/redact.js rename to commands/fediverse/redact.js diff --git a/commands/reply.js b/commands/fediverse/reply.js similarity index 100% rename from commands/reply.js rename to commands/fediverse/reply.js diff --git a/commands/status.js b/commands/fediverse/status.js similarity index 100% rename from commands/status.js rename to commands/fediverse/status.js diff --git a/commands/tip.js b/commands/fediverse/tip.js similarity index 100% rename from commands/tip.js rename to commands/fediverse/tip.js diff --git a/commands/unfren.js b/commands/fediverse/unfollow.js similarity index 100% rename from commands/unfren.js rename to commands/fediverse/unfollow.js diff --git a/commands/unpin.js b/commands/fediverse/unpin.js similarity index 100% rename from commands/unpin.js rename to commands/fediverse/unpin.js diff --git a/commands/help.js b/commands/help.js index 5e59bdf..f07555c 100644 --- a/commands/help.js +++ b/commands/help.js @@ -4,12 +4,12 @@ exports.runQuery = function (matrixClient, room) { '
fediverse commands
' + '+plemara [your message] : post
' + '+redact [post id] : delete post
' - + '+fren [user id] : follow
' - + '+unfren [user id] : unfollow
' + + '+follow [user id] : follow
' + + '+unfollow [user id] : unfollow
' + '+copy [post id] : repeat/repost/retweet
' + '+reply [post id] [content] : reply to post
' - + '+tip [@user@fedi.url] [amount] : tip 10grans' - + '+beg : beg for 10grans' + + '+tip [@user@fedi.url] [amount] : tip 10grans
' + + '+beg : beg for 10grans
' + '+clap [post id] : favorite
' + '+boo [post id] : unfavorite
' + '
channel commands
' diff --git a/registrar.js b/registrar.js index 5421471..c617944 100644 --- a/registrar.js +++ b/registrar.js @@ -1,24 +1,24 @@ module.exports = { config: require('./config.js'), - boo: require('./commands/boo.js'), - beg: require('./commands/beg.js'), - clap: require('./commands/clap.js'), - copy: require('./commands/copy.js'), - flood: require('./commands/flood.js'), - fren: require('./commands/fren.js'), - help: require('./commands/help.js'), - pin: require('./commands/pin.js'), - plemara: require('./commands/plemara.js'), - redact: require('./commands/redact.js'), - notify: require('./commands/notify.js'), - reply: require('./commands/reply.js'), - tip: require('./commands/tip.js'), - unfren: require('./commands/unfren.js'), - unpin: require('./commands/unpin.js'), - mordy: require('./commands/mordy.js'), archive: require('./commands/archive.js'), - nitter: require('./commands/nitter.js'), invidious: require('./commands/invidious.js'), - media: require('./commands/media.js'), - status: require('./commands/status.js') + nitter: require('./commands/nitter.js'), + beg: require('./commands/fediverse/beg.js'), + boo: require('./commands/fediverse/boo.js'), + clap: require('./commands/fediverse/clap.js'), + copy: require('./commands/fediverse/copy.js'), + flood: require('./commands/fediverse/flood.js'), + follow: require('./commands/fediverse/follow.js'), + help: require('./commands/fediverse/help.js'), + media: require('./commands/fediverse/media.js'), + mordy: require('./commands/fediverse/mordy.js'), + notify: require('./commands/fediverse/notify.js'), + pin: require('./commands/fediverse/pin.js'), + post: require('./commands/fediverse/post.js'), + redact: require('./commands/fediverse/redact.js'), + reply: require('./commands/fediverse/reply.js'), + status: require('./commands/fediverse/status.js'), + tip: require('./commands/fediverse/tip.js'), + unfollow: require('./commands/fediverse/unfollow.js'), + unpin: require('./commands/fediverse/unpin.js') };