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

Support new tell syntax and deprecate old #584

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions modules/tell.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,9 @@ def setup(self):
loadReminders(self)
alias.loadAliases(self)

def f_remind(phenny, input, verb):
def f_remind(phenny, tellee, msg, verb, input):
teller = input.nick

# @@ Multiple comma-separated tellees? Cf. Terje, #swhack, 2006-04-15
tellee, msg = input.groups()

aliases = alias.aliasGroupFor(teller)

tellee_original = tellee.rstrip('.,:;')
Expand Down Expand Up @@ -71,15 +68,22 @@ def f_remind(phenny, input, verb):
dumpReminders(phenny)

def f_tell(phenny, input):
f_remind(phenny, input, 'tell')
phenny.say('{}: `begiak: ask`/`begiak: tell` is deprecated. Please use `.ask` or `.tell` in the future.'.format(input.nick))
f_remind(phenny, input.group()[0], input.groups()[1], 'tell', input)
f_tell.rule = ('$nick', ['tell'], r'(\S+) (.*)')
f_tell.thread = False

def f_ask(phenny, input):
f_remind(phenny, input, 'ask')
phenny.say('{}: `begiak: ask`/`begiak: tell` is deprecated. Please use `.ask` or `.tell` in the future.'.format(input.nick))
f_remind(phenny, input.group()[0], input.groups()[1], 'ask', input)
f_ask.rule = ('$nick', ['ask'], r'(\S+) (.*)')
f_ask.thread = False

def f_tell_dot(phenny, input):
f_remind(phenny, input.group().split(' ')[1], ' '.join(input.group().split(' ')[2:]), input.group().split(' ')[0][1:], input)
f_tell_dot.commands = ['tell', 'inform', 'alert', 'notify', 'ask']
f_tell_dot.thread = False

def formatReminder(r, tellee, recipient=None):
if not recipient:
recipient = tellee
Expand Down