Skip to content

Instantly share code, notes, and snippets.

@5nyper
Last active August 29, 2015 14:11
Show Gist options
  • Save 5nyper/b385dcaa334d7dba743c to your computer and use it in GitHub Desktop.
Save 5nyper/b385dcaa334d7dba743c to your computer and use it in GitHub Desktop.
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