pwz*_*000 -2 ruby ruby-on-rails
我收到以下与以下相关的错误announcement.rb:
语法错误,意外的tIDENTIFIER,期待keyword_end(SyntaxError)放置"致命错误:"+ e.message
我已经查看了下面的代码,看起来是正确的.有人似乎是错误吗?
Twit::Part.new :announcement do
every 30, :minutes do
ids = @config[:ids].shift(15) # take 25 ids at a time
next if ids.empty? # do not do anything if there are no ids anymore
ids.each do |id|
begin
# look up the user name behind the ID, keep in mind that the
# endpoint for that might be rate limited
username = bot.user(id, skip_status: true)&.screen_name
if username.nil?
@config[:ids] << id
next
end
# finally, tweet the message:
bot.tweet "@#{username} Hey, check out my cool site!”
# and add the id to the :already_tweeted list
@config[:already_tweeted] << id
rescue => e
puts "fatal error: " + e.message
@config[:ids] << id
end
end
bot.save_config
end
end
Run Code Online (Sandbox Code Playgroud)
"@#{username} Hey, check out my cool site!”
?
Run Code Online (Sandbox Code Playgroud)
应该
"@#{username} Hey, check out my cool site!"
?
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
75 次 |
| 最近记录: |