Merge lp:~andrea.corbellini/ubuntu-bots/i-am-only-a-bot-reply into lp:ubuntu-bots

Proposed by Andrea Corbellini
Status: Merged
Merged at revision: 245
Proposed branch: lp:~andrea.corbellini/ubuntu-bots/i-am-only-a-bot-reply
Merge into: lp:ubuntu-bots
Diff against target: 21 lines (+2/-2)
1 file modified
Encyclopedia/plugin.py (+2/-2)
To merge this branch: bzr merge lp:~andrea.corbellini/ubuntu-bots/i-am-only-a-bot-reply
Reviewer Review Type Date Requested Status
m4v Approve
Review via email: mp+60322@code.launchpad.net

Description of the change

When a user tries to speak with the bot, reply to him, so the message doesn't get lost and is easy to find.

Before:

  <foobar> hello ubottu
  <ubottu> Error: I am only a bot, please don't think I'm intelligent :)

After:

  <foobar> hello ubottu
  <ubottu> foobar: I am only a bot, please don't think I'm intelligent :)

To post a comment you must log in.
Revision history for this message
m4v (m4v) wrote :

Andrea, thanks for helping us with Ubottu! :D

I agree with you in changing the way ubottu says the "I'm not smart" message, however, this patch only gets rid of the "Error: " bit of text, it doesn't prefix the user's nick like your description says, it will say "<ubottu> I am only a bot ..." If you want the bot to address the user, you have to use prefixNick=True, like irc.reply("I am only a bot ...", prefixNick=True)

Andrea, since your patch doesn't quite does what the description says, I'm not sure if I should approve, will you revise it? :) You can test it by setting up an ubottu clone, if you need help with that you can join #ubuntu-bots-devel on freenode and ask me or tsimpson.

246. By Andrea Corbellini

Pass prefixNick=True.

Revision history for this message
Andrea Corbellini (andrea.corbellini) wrote :

Hi and thanks for your reply.

You're right, my bad! I've added a new revision which adds prefixNick=True to the calls to irc.reply(). It should be OK now.

Thanks,
Andrea

Revision history for this message
m4v (m4v) :
review: Approve
Revision history for this message
m4v (m4v) wrote :

merged into devel, thanks for your work!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Encyclopedia/plugin.py'
2--- Encyclopedia/plugin.py 2011-03-24 22:55:50 +0000
3+++ Encyclopedia/plugin.py 2011-05-09 12:25:50 +0000
4@@ -503,7 +503,7 @@
5 or channel in self.registryValue('editchannel') \
6 and capab(msg.prefix, 'restricted-editor')):
7 if len(text[:text.find('is')]) > 15:
8- irc.error("I am only a bot, please don't think I'm intelligent :)")
9+ irc.reply("I am only a bot, please don't think I'm intelligent :)", prefixNick=True)
10 else:
11 irc.reply("Your edit request has been forwarded to %s. Thank you for your attention to detail" %
12 self.registryValue('relaychannel',channel),private=True)
13@@ -520,7 +520,7 @@
14
15 if not ret:
16 if len(text) > 15:
17- irc.error("I am only a bot, please don't think I'm intelligent :)")
18+ irc.reply("I am only a bot, please don't think I'm intelligent :)", prefixNick=True)
19 return
20 retmsg = ''
21 ret = self.registryValue('notfoundmsg')

Subscribers

People subscribed via source and target branches