Skip to content

jrobertson/botbase-module-alias

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Introducing the botbase-module-alias gem

Testing the botbase module

require 'botbase-module-alias'


class DummyBot

  def received(msg, mode: nil, echo_node: nil)
    puts 'received: ' + msg
  end
end

dummy = DummyBot.new
bma = BotBaseModuleAlias.new aliases: '/home/james/jamesrobertson.eu/qbx/r/speech_alias.txt', callback: dummy
r = bma.query 'create a new password'
#=> received: lpa

file (speech_alias.txt):

<?dynarex schema="keywords[title, tags]/keyword(title, aliasname, hashtags)"?>
title: Speech alias
tags: alias speech verbose phrase
--+


t: ^create a new password$
a: lpa
h: password

t: ^create a random word$
a: rwo
h: password

In the code snippet above the botbase-module-alias gem queries a lookfile for a matching phrase and returns the associated alias command. Alias commands are convenient to type from the command-line, however with speech recognition it is easier to say the verbose command.

Resources

botbase plugin alias aliases

About

A botbase module plugin which matched a verbose command with a known alias command from a lookup file.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages