Added tweet and toot commands

This commit is contained in:
Erik C. Thauvin 2023-01-04 02:54:13 -08:00
parent db931f1f23
commit 7f7fd43b8d
3 changed files with 13 additions and 5 deletions

View file

@ -91,6 +91,7 @@ class Mastodon : SocialModule() {
const val INSTANCE_PROP = "mastodon-instance"
private const val MASTODON_CMD = "mastodon"
private const val TOOT_CMD = "toot"
/**
* Post on Mastodon.
@ -140,8 +141,9 @@ class Mastodon : SocialModule() {
init {
commands.add(MASTODON_CMD)
help.add("To post to Mastodon:")
help.add(Utils.helpFormat("%c $MASTODON_CMD <message>"))
commands.add(TOOT_CMD)
help.add("To toot on Mastodon:")
help.add(Utils.helpFormat("%c $TOOT_CMD <message>"))
properties[AUTO_POST_PROP] = "false"
initProperties(ACCESS_TOKEN_PROP, HANDLE_PROP, INSTANCE_PROP)
}

View file

@ -86,6 +86,7 @@ class Twitter : SocialModule() {
// Twitter command
private const val TWITTER_CMD = "twitter"
private const val TWEET_CMD = "tweet"
/**
* Post on Twitter.
@ -124,8 +125,9 @@ class Twitter : SocialModule() {
init {
commands.add(TWITTER_CMD)
help.add("To post to Twitter:")
help.add(helpFormat("%c $TWITTER_CMD <message>"))
commands.add(TWEET_CMD)
help.add("To tweet on Twitter:")
help.add(helpFormat("%c $TWEET_CMD <message>"))
properties[AUTO_POST_PROP] = "false"
initProperties(CONSUMER_KEY_PROP, CONSUMER_SECRET_PROP, HANDLE_PROP, TOKEN_PROP, TOKEN_SECRET_PROP)
}

View file

@ -48,6 +48,7 @@
<li><a href="https://github.com/pircbotx/pircbotx">PircBotX</a></li>
<li><a href="https://rometools.github.io/rome/">Rome</a></li>
<li><a href="http://twitter4j.org/en/index.html">Twitter4J</a></li>
<li><a href="https://github.com/ethauvin/urlencoder">UrlEncoder</a></li>
</ul>
<p>mobibot was written by
<a href="https://erik.thauvin.net/"><strong>Erik C. Thauvin</strong></a> as a replacement for the channel's
@ -122,7 +123,10 @@
<div><code>mobibot: paper</code></div>
<div><code>mobibot: rock</code></div>
</li>
<li>Posting to <a href="https://twitter.com/mobitopia">Twitter</a> and <a href="https://joinmastodon.org/">Mastodon</a></li>
<li>Posting to <a href="https://twitter.com/mobitopia">Twitter</a> and <a href="https://joinmastodon.org/">Mastodon</a>
<div><code>mobibot: tweet hello twitter</code></div>
<div><code>mobibot: toot hello mastodon</code></div>
</li>
</ul>
<p>Some of the internal features include RSS feed backlogs, rolling logs, debugging toggle and much more.</p>