Added tweet and toot commands
This commit is contained in:
parent
db931f1f23
commit
7f7fd43b8d
3 changed files with 13 additions and 5 deletions
|
@ -91,6 +91,7 @@ class Mastodon : SocialModule() {
|
||||||
const val INSTANCE_PROP = "mastodon-instance"
|
const val INSTANCE_PROP = "mastodon-instance"
|
||||||
|
|
||||||
private const val MASTODON_CMD = "mastodon"
|
private const val MASTODON_CMD = "mastodon"
|
||||||
|
private const val TOOT_CMD = "toot"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post on Mastodon.
|
* Post on Mastodon.
|
||||||
|
@ -140,8 +141,9 @@ class Mastodon : SocialModule() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
commands.add(MASTODON_CMD)
|
commands.add(MASTODON_CMD)
|
||||||
help.add("To post to Mastodon:")
|
commands.add(TOOT_CMD)
|
||||||
help.add(Utils.helpFormat("%c $MASTODON_CMD <message>"))
|
help.add("To toot on Mastodon:")
|
||||||
|
help.add(Utils.helpFormat("%c $TOOT_CMD <message>"))
|
||||||
properties[AUTO_POST_PROP] = "false"
|
properties[AUTO_POST_PROP] = "false"
|
||||||
initProperties(ACCESS_TOKEN_PROP, HANDLE_PROP, INSTANCE_PROP)
|
initProperties(ACCESS_TOKEN_PROP, HANDLE_PROP, INSTANCE_PROP)
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,6 +86,7 @@ class Twitter : SocialModule() {
|
||||||
|
|
||||||
// Twitter command
|
// Twitter command
|
||||||
private const val TWITTER_CMD = "twitter"
|
private const val TWITTER_CMD = "twitter"
|
||||||
|
private const val TWEET_CMD = "tweet"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Post on Twitter.
|
* Post on Twitter.
|
||||||
|
@ -124,8 +125,9 @@ class Twitter : SocialModule() {
|
||||||
|
|
||||||
init {
|
init {
|
||||||
commands.add(TWITTER_CMD)
|
commands.add(TWITTER_CMD)
|
||||||
help.add("To post to Twitter:")
|
commands.add(TWEET_CMD)
|
||||||
help.add(helpFormat("%c $TWITTER_CMD <message>"))
|
help.add("To tweet on Twitter:")
|
||||||
|
help.add(helpFormat("%c $TWEET_CMD <message>"))
|
||||||
properties[AUTO_POST_PROP] = "false"
|
properties[AUTO_POST_PROP] = "false"
|
||||||
initProperties(CONSUMER_KEY_PROP, CONSUMER_SECRET_PROP, HANDLE_PROP, TOKEN_PROP, TOKEN_SECRET_PROP)
|
initProperties(CONSUMER_KEY_PROP, CONSUMER_SECRET_PROP, HANDLE_PROP, TOKEN_PROP, TOKEN_SECRET_PROP)
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
<li><a href="https://github.com/pircbotx/pircbotx">PircBotX</a></li>
|
<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="https://rometools.github.io/rome/">Rome</a></li>
|
||||||
<li><a href="http://twitter4j.org/en/index.html">Twitter4J</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>
|
</ul>
|
||||||
<p>mobibot was written by
|
<p>mobibot was written by
|
||||||
<a href="https://erik.thauvin.net/"><strong>Erik C. Thauvin</strong></a> as a replacement for the channel's
|
<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: paper</code></div>
|
||||||
<div><code>mobibot: rock</code></div>
|
<div><code>mobibot: rock</code></div>
|
||||||
</li>
|
</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>
|
</ul>
|
||||||
<p>Some of the internal features include RSS feed backlogs, rolling logs, debugging toggle and much more.</p>
|
<p>Some of the internal features include RSS feed backlogs, rolling logs, debugging toggle and much more.</p>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue