mirror of
https://github.com/thewesker/twitter_ebooks.git
synced 2025-12-20 12:21:11 -05:00
Fix off-by-one error in mentionless calculation
This commit is contained in:
@@ -103,7 +103,7 @@ module Ebooks
|
|||||||
mless = ev[:text]
|
mless = ev[:text]
|
||||||
begin
|
begin
|
||||||
ev.attrs[:entities][:user_mentions].reverse.each do |entity|
|
ev.attrs[:entities][:user_mentions].reverse.each do |entity|
|
||||||
mless = mless[0...entity[:indices][0]] + mless[entity[:indices][1]...-1]
|
mless = mless[0...entity[:indices][0]] + mless[entity[:indices][1]+1..-1]
|
||||||
end
|
end
|
||||||
rescue Exception
|
rescue Exception
|
||||||
p ev.attrs[:entities][:user_mentions]
|
p ev.attrs[:entities][:user_mentions]
|
||||||
@@ -136,7 +136,6 @@ module Ebooks
|
|||||||
# Applies configurable @reply_delay range
|
# Applies configurable @reply_delay range
|
||||||
def reply(ev, text, opts={})
|
def reply(ev, text, opts={})
|
||||||
opts = opts.clone
|
opts = opts.clone
|
||||||
delay = @reply_delay.to_a.sample
|
|
||||||
|
|
||||||
if ev.is_a? Twitter::DirectMessage
|
if ev.is_a? Twitter::DirectMessage
|
||||||
log "Sending DM to @#{ev[:sender][:screen_name]}: #{text}"
|
log "Sending DM to @#{ev[:sender][:screen_name]}: #{text}"
|
||||||
|
|||||||
Reference in New Issue
Block a user