def mode_cmd(mode, text, text_inp, chan, conn, notice):
 split = text_inp.split(' ')
 if split[0].startswith('#'):
  channel = split[0]
  target = split[1]
  notice('Attempting to {} {} in {}...'.format(text, target, channel))
  conn.send('MODE {} {} {}'.format(channel, mode, target))
 else:
  channel = chan
  target = split[0]
  notice('Attempting to {} {} in {}...'.format(text, target, channel))
  conn.send('MODE {} {} {}'.format(channel, mode, target))

def mode_cmd ( mode , text , text_inp , chan , conn , notice ) : split = text_inp . split ( ' ' ) if split [ 0 ] . startswith ( '#' ) : channel = split [ 0 ] target = split [ 1 ] notice ( 'Attempting to {} {} in {}...' . format ( text , target , channel ) ) conn . send ( 'MODE {} {} {}' . format ( channel , mode , target ) ) else : channel = chan target = split [ 0 ] notice ( 'Attempting to {} {} in {}...' . format ( text , target , channel ) ) conn . send ( 'MODE {} {} {}' . format ( channel , mode , target ) )
generic mode setting function .