mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
w2n
This commit is contained in:
parent
20f298d452
commit
e5f21a1cdd
@ -9,6 +9,7 @@ from sopel.tools import Identifier
|
|||||||
import functools
|
import functools
|
||||||
import copy
|
import copy
|
||||||
import datetime
|
import datetime
|
||||||
|
from word2number import w2n
|
||||||
|
|
||||||
import spicemanip
|
import spicemanip
|
||||||
|
|
||||||
@ -413,7 +414,11 @@ def trigger_hyphen_args(trigger_args_part):
|
|||||||
elif str(clipped_word).isdigit():
|
elif str(clipped_word).isdigit():
|
||||||
hyphen_args.append(int(clipped_word))
|
hyphen_args.append(int(clipped_word))
|
||||||
else:
|
else:
|
||||||
trigger_args_unhyphend.append(worditem)
|
try:
|
||||||
|
clipped_word = w2n.word_to_num(str(clipped_word))
|
||||||
|
hyphen_args.append(int(clipped_word))
|
||||||
|
except ValueError:
|
||||||
|
trigger_args_unhyphend.append(worditem)
|
||||||
else:
|
else:
|
||||||
trigger_args_unhyphend.append(worditem)
|
trigger_args_unhyphend.append(worditem)
|
||||||
if len(hyphen_args):
|
if len(hyphen_args):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user