xmikos / hangupsbot Goto Github PK
View Code? Open in Web Editor NEWBot for Google Hangouts
License: GNU General Public License v3.0
Bot for Google Hangouts
License: GNU General Public License v3.0
For example [["hi bot"], "Hello world!"] would not be triggered when typing "hi bot".
How to retrieve email id of user who sent the message to bot before it is added to conversation i.e. new users?
I have tried accessing all the possible methods, but unable to get the email id (first name and last name are there) of new users(who are not in the conversation list).
pi@raspberrypi ~/hangupsbot $ python3 hangupsbot
Traceback (most recent call last):
File "/usr/lib/python3.2/runpy.py", line 143, in _run_module_as_main
mod_name, loader, code, fname = _get_main_module_details()
File "/usr/lib/python3.2/runpy.py", line 186, in _get_main_module_details
return _get_module_details(main_name)
File "/usr/lib/python3.2/runpy.py", line 115, in _get_module_details
code = loader.get_code(mod_name)
File "/usr/lib/python3.2/pkgutil.py", line 281, in get_code
self.code = compile(source, self.filename, 'exec')
File "/home/pi/hangupsbot/hangupsbot/main.py", line 115
res = yield from http_utils.fetch('get', link)
^
SyntaxError: invalid syntax
is there any way to fix this? I'm using python3.4.3.
Hangupsbot does not connect and gives error: "_on_connect() missing required positional argument 'initial_data'".
On line 179 the call is missing the 'initial_data' variable:
self._clienton_connect.add_observer(self._on_connect)
Best regards:
Mikael
I'm trying to use some admin commands, but the bot doesn't seem to recognize me as admin, I've added both the conversation id and hangouts username of the person I want to set as admin, but I'm still getting the "I'm sorry Dave" error. What do I enter into config.json to set someone as admin?
I am running hangupsbot on a google compute engine vm instance, but the problem is after a certain period of time(due to inactivity), it disconnects and stops responding to the messages.
How to make that bot always running on that vm?
At
It is said that the usage is "/bot leave" whereas all other command, the in-chat-command is the same name as the python function. I don't see any redefinition for this particular case. Is that a mistake in code or am I missing something?
Thanks.
PS : Are issues a good way to ask this kind of question? Or is there a better way?
After sucessfull token exchange, may the special chars in the hangouts:
Connected!
Conversations:
Client unexpectedly disconnected:
'ascii' codec can't encode character '\xfc' in position 18: ordinal not in range(128)
Waiting 5 seconds...
Trying to connect again (try 1 of 5)...
Connected!
Conversations:
Client unexpectedly disconnected:
'ascii' codec can't encode character '\xfc' in position 18: ordinal not in range(128)
Waiting 5 seconds...
hangups is running ok in my system. Now I am trying to use hangupsbot. I have gone through all the instructions given in the documentation at https://github.com/xmikos/hangupsbot/blob/master/README.rst
but I am unable to run hungupsbot.
Is there a way that within a command, the bot waits for an answer?
Example:
User command: get_forecast
Bot answer: Where?
User: "new york"
Everything within the same command
After installing a fresh version of all dependencies and hangupsbot itself, this error is given when attempting to run hangupsbot.
Traceback (most recent call last):
File "/usr/local/bin/hangupsbot", line 11, in
load_entry_point('HangupsBot==1.7.1', 'console_scripts', 'hangupsbot')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.8/dist-packages/HangupsBot-1.7.1-py3.8.egg/hangupsbot/main.py", line 90
asyncio.async(
^
SyntaxError: invalid syntax
Using python 3.8.2, asyncio 0.4.1 ( also tried the most recent version 3.4.3) and appdirs 1.4.4
Hi
How do i use the command "/bot conv_add" correctly ?
I always get the error:
Request failed with status 4: 'At least one invitee is required'
Following the instructions in the conversations.py
"Usage: /bot conv_add conversation_name [user_name_1] [user_name_2] [...]",
i tried:
-/bot conv_add . 123000000000000 (the gaia_id)
-/bot conv_add . [email protected]
-/bot conv_add . john.snow
and everything with "" and []:
-/bot conv_add . "123000000000000"
-/bot conv_add . [123000000000000]
...
What am i doing wrong?
Same at "/bot conv_create":
This command produces the error:
'ConversationList' object has no attribute 'add_conversation'
when i type:
/bot conv_create Test 12300000000000 124000000000000
or
/bot conv_create Test [email protected] [email protected]
Please help
I am making a bot which can initiate a conversation with some mail ids in my database. I can retrieve the mail ids from my database but how do i send any message to those mail ids(those are not in the conversation list).
I have made a bot in api.ai, but they don't provide integration with hangouts. hangupsbot seems to be the solution but I am not sure, is it possible?.
If its possible, how do I use hangups bot as a webservice to get and respond to the bot made in api.ai.
I seem to be experiencing an inevitable crash of hangupsbot. Not sure if you are still working on it, so no worries if not, but fwiw, the relevant traceback is below.
This has occurred each time I've tested it, a couple minutes into running and successful bot responses.
Exception ignored in: <bound method _UnixSelectorEventLoop.__del__ of <_UnixSelectorEventLoop running=False closed=True debug=False>>
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/base_events.py", line 361, in __del__
File "/usr/lib/python3.4/asyncio/unix_events.py", line 57, in close
File "/usr/lib/python3.4/asyncio/unix_events.py", line 138, in remove_signal_handler
TypeError: signal handler must be signal.SIG_IGN, signal.SIG_DFL, or a callable object
I just got hangups and hangupsbot setup and running.
I am not quite sure how to configure hangupsbot to do autoreplies and handle commands.
{
"admins": ["MY_USERNAME"],
"autoreplies": [
[["hi", "hello"], "Hello world!"],
[["bot"], "At your service!"]
],
"autoreplies_enabled": true,
"commands_admin": ["quit", "config"],
"commands_enabled": true,
"commands_aliases": ["/bot", "/hal", "/cylon", "/skynet", "/terminator"],
"forwarding_enabled": true,
"conversations": {
"UgwELlTjFXV9qwSBsB94AaABAQ": {
"autoreplies_enabled": true,
"commands_enabled": true
}
}
}
I have one conversation that I want to be active, but when I message in that chat, nothing seems to be happening.
I've cloned the repo, ran setup.py install, and pip3 belives all the dependencies are satisfied. hangupsbot returns:
Traceback (most recent call last):
File "/usr/bin/hangupsbot", line 4, in <module>
hangupsbot.main()
File "/usr/lib/python3.4/site-packages/hangupsbot/hangupsbot.py", line 284, in main
bot = HangupsBot(args.cookies, args.config)
File "/usr/lib/python3.4/site-packages/hangupsbot/hangupsbot.py", line 51, in __init__
self.config = hangupsbot.config.Config(config_path)
File "/usr/lib/python3.4/site-packages/hangupsbot/config.py", line 11, in __init__
self.load()
File "/usr/lib/python3.4/site-packages/hangupsbot/config.py", line 16, in load
self.config = json.load(open(self.filename))
File "/usr/lib/python3.4/json/__init__.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.4/json/__init__.py", line 318, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
raise ValueError(errmsg("Expecting value", s, err.value)) from None
ValueError: Expecting value: line 5 column 3 (char 100)
Hangups is global and works correctly. I recently ran this bot on an older computer without problem, maybe issues with a newer version of hangups?
Client unexpectedly disconnected:
_on_connect() missing 1 required positional argument: 'initial_data'
Traceback (most recent call last):
File "/home/user/projects/hubot/node_modules/hubot-hangups/HangoutsBot/hangupsbot.py", line 137, in run
loop.run_until_complete(self._client.connect())
File "/usr/lib/python3.4/asyncio/base_events.py", line 208, in run_until_complete
return future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 243, in result
raise self._exception
File "/usr/lib/python3.4/asyncio/tasks.py", line 298, in _step
result = coro.throw(exc)
File "/usr/local/lib/python3.4/dist-packages/hangups/client.py", line 99, in connect
yield from self._listen_future
File "/usr/lib/python3.4/asyncio/futures.py", line 348, in iter
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.4/asyncio/tasks.py", line 351, in _wakeup
value = future.result()
File "/usr/lib/python3.4/asyncio/futures.py", line 243, in result
raise self._exception
File "/usr/lib/python3.4/asyncio/tasks.py", line 300, in _step
result = coro.send(value)
File "/usr/local/lib/python3.4/dist-packages/hangups/channel.py", line 214, in listen
yield from self._longpoll_request()
File "/usr/local/lib/python3.4/dist-packages/hangups/channel.py", line 343, in _longpoll_request
yield from self._on_push_data(chunk)
File "/usr/local/lib/python3.4/dist-packages/hangups/channel.py", line 364, in _on_push_data
yield from self.on_connect.fire()
File "/usr/local/lib/python3.4/dist-packages/hangups/event.py", line 50, in fire
yield from gen
File "/usr/local/lib/python3.4/dist-packages/hangups/event.py", line 48, in fire
gen = observer(_args, *_kwargs)
TypeError: _on_connect() missing 1 required positional argument: 'initial_data'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.