@@ -268,8 +268,6 @@ def handle_message(self, message):
268
268
first = message .text [1 :].split ()[0 ]
269
269
if first == "alias" :
270
270
self .handle_alias_assign (message )
271
- elif first == "overwrite" :
272
- self .handle_alias_assign (message , overwrite = True )
273
271
elif first in self .commands or first in self .aliases :
274
272
self .worker_pool .apply_async (self .handle_command , args = (message ,))
275
273
@@ -311,17 +309,14 @@ def call_triggered(self, func, message, pre=[], post=[]):
311
309
print ("*** print_tb:" )
312
310
traceback .print_tb (exc_traceback , file = sys .stdout )
313
311
314
- def handle_alias_assign (self , message , overwrite = False ):
312
+ def handle_alias_assign (self , message ):
315
313
try :
316
314
name , * alias = message .text [len (self .command_char )+ 5 :].split ("=" )
317
315
name = name .strip ()
318
316
alias = "=" .join (alias ).strip ()
319
317
if name in self .commands :
320
318
raise Exception ("cannot overwrite existing command" )
321
319
322
- if name in self .aliases and not overwrite :
323
- raise Exception ("alias already exists. Use the overwrite command to override." )
324
-
325
320
commands = map (lambda x : [(command , " " .join (args )) for command , * args in [x .split (" " )]][0 ],
326
321
map (lambda x : x .strip (), alias .split (" || " )))
327
322
funcs = []
0 commit comments