机器人如何在Google Wave中私下回复您?

时间:2010-01-11 02:47:07

标签: private google-wave privacy robot

Google Wave允许两个或更多参与者在wave中私下发言。当我的机器人被添加到wave中时,我会识别WAVELET_SELF_ADDED事件并调用下面的方法。然而,没有任何反应。

我可以告诉代码是由于日志中的Debug和Info语句而执行的。 是否有任何理由说明机器人在添加时不会启动私人短信?

def start_private_wavelet(properties, context):
    """Start a private conversation between the robot and some participants."""
    participants = []
    participants.append('my-username@googlewave.com')
    participants.append('my-robot@appspot.com')

    logging.debug('Getting wave info')

    root_wavelet = context.GetRootWavelet()
    root_wave_id = root_wavelet.GetWaveId()
    root_wave = context.GetWaveById(root_wave_id)

    logging.debug('Creating private wave in %s' % root_wave_id)

    private_wavelet = root_wave.CreateWavelet(participants)
    message = private_wavelet.CreateBlip()
    message.GetDocument().SetText("This is a private conversation...")

    logging.debug('Private wave created')

1 个答案:

答案 0 :(得分:2)

通过Wavelet创建私有转换。

因此,使用Python API,我认为您正在寻找OpBasedWave.CreateWavelet

participants = []
participants.append('other-user@googlewave.com')
participants.append('self-robot@appspot.com') # Remember to add your robot!

private_wavelet = root_wave.CreateWavelet(participants)
message = private_wavelet.CreateBlip()
message.GetDocument().SetText("Hi there, this is just a secret!")