Advertisement
TheRealKingS

Untitled

Mar 2nd, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.71 KB | None | 0 0
  1. Twittbot::BotPart.new :random_reply do
  2.   # When someone mentions the bot...
  3.   on :mention do |tweet|
  4.     # ... reply to the tweet with a random entry of the :replies list that you
  5.     # configured and also include every person that was mentioned in the tweet.
  6.     tweet.reply @config[:replies].sample, reply_all: true
  7.   end
  8.  
  9. ## Uncomment the next few lines if you want to add new tweets to the tweet
  10.   ## list on the fly using direct messages.
  11.   ##
  12.   ## Example usage:
  13.   ## !addr Tweet text
  14.   cmd :addr do |args|
  15.   #  # adds args (usually the tweet text) to the list of random tweets unless
  16.   #  # args already is in the list
  17.     @config[:replys] << args unless @config[:tweets].include? args
  18.   end
  19.  
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement