Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run? #1

Open
thejustsoul opened this issue Mar 28, 2016 · 5 comments
Open

How to run? #1

thejustsoul opened this issue Mar 28, 2016 · 5 comments

Comments

@thejustsoul
Copy link

How to run your bot in my server? Ubuntu Server 14.04\Windows\x64.
Please, step-by-step.

@shizeeg
Copy link
Owner

shizeeg commented Feb 6, 2017

I've added INSTALL.md In General:

$ export GOPATH=$HOME/go # make sure you have your GOPATH exported.
$ go get github.com/shizeeg/jagod # install & build sources `jagod` should be found in `$GOPATH/bin` after this
$ sudo cp $GOPATH/bin/jagod /usr/local/bin # or whatever you prefer
# edit jago.cfg file, put jabber id (JID) info etc.
# now you can run it:
$ jagod
# that's it.

@thejustsoul
Copy link
Author

Thanks for fast answer :-)
I have successfully launched bot on windows, as follows:
jagod.exe -c jagod.cfg -p jagod.pid
Even some commands work in the conference (except google, yandex, tr, calc, weather..).

How to install plugins which are in \src\github.com\shizeeg\jagod\plugins?
And\or add new plugins (needs to be writen in Go?)
How to remove prefix in conferences, for example the ping command worked without !! and !

@shizeeg
Copy link
Owner

shizeeg commented Feb 7, 2017

a fast answer? It's almost a year. =D OK about plugins... You have to compile existing plugins separately. Technically a plugin is a standalone command-line utility that should take 2+ parameters. First parameter jagod passes to a plugin is always -lang=en if not defined otherwise. Here the actual dispatcher: https://github.com/shizeeg/jagod/blob/master/plugin.go#L19-L24

so a plugin can be any command line executable (written in any language), that can take 2+ parameters and produces textual output. Here is an example of a plugin in shell-script called tld:

#!/bin/sh

/usr/bin/whois "${2}" | grep 'address:' | sed 's|  ||g' | cut -d ':' -f2 | tail -1

you may call a file whatever you like and add it to jago.cfg somewhere after [plugins] section like that:

[plugins]
CALC="excalc"
GOOGLE="google"
SPELL="yandex spell"
TR="yandex"
WEATHER="gismeteo"
TLD="tld" # here

On Windows you probably should place all needed plugins in the same directory with main executable. (jagod) but it's not tested.

google plugin doesn't work, api v1 has been shut down and api v2 is too complicated.
other plugins should work. To make yandex work, you need to get an api key and put it into jago.cfg:

[yandex]
dictapi="dict.1.1.bla-bla"

here is the link: https://tech.yandex.com/keys/get/?service=dict


About command prefix: !! aliases are not implemented yet. So you can't change command name like with other bots, sorry. But you can change prefix character itself here: https://github.com/shizeeg/jagod/blob/master/etc/jagod.cfg#L20

Note about why you have to double the prefix: the syntax of command parser is:

!section command [parameters]

<prefix><section> and optional parameters. But I'm too lazy to implement actual sections so you may put any character instead. The most simple thing is just double the prefix.

!bla yandex en-ru hello would work just fine.

@thejustsoul
Copy link
Author

Nice. Thanks for help -)

@shizeeg
Copy link
Owner

shizeeg commented Feb 7, 2017

thanks for your interest in my humble project. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants