Last active
August 29, 2015 14:11
-
-
Save 5nyper/b385dcaa334d7dba743c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'bing_translator' | |
lang = ""; | |
@str = ""; | |
puts "Billy.rb v.0.0.1 Connected!" | |
def trans() | |
translator = BingTranslator.new('TurboFanTrans', 'Gkqa2Ru37DeHAfR4AdH/sj94J5Ge1S8Ad7Spp89MMIs=') | |
transl = translator.translate @str, :to => 'fr' | |
puts transl; | |
end | |
def read_command() | |
input_s = gets.chomp | |
command,*args = input_s.split | |
if command[0] == "!" | |
case command | |
when '!say' | |
puts args.join(' '); | |
when '!translate' | |
@str << args.join(' ') | |
trans() | |
@str << ""; | |
else | |
puts "Command #{command} not known!" | |
end | |
end | |
end | |
read_command() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment